laforge submitted this change.

View Change

Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved
Move peer to DELETED state before signalling parent FSM with DELETE_(N)ACK

When receiving SMSCB_E_CBSP_DELETE_(N)ACK, smscb_message_fsm will iterate
over all peers to find out if some of them has still not ended, and in
that case delay sending an HTTP result.
However, the peer was sending the signal before moving to DELETED state,
and hence smscb_message_fsm would never send the HTTP result until T3
(T_WAIT_DELETE_ACK) would time out after it:
"""
20220629104312596 DCBSP INFO SMSCB-PEER(TTCN-3-44-ttcn3)[0x560b46c1f770]{WAIT_DELETE_ACK}: Received Event DELETE_ACK (cbsp_server_fsm.c:348)
20220629104312596 DCBSP INFO SMSCB(TTCN-3-44)[0x560b46c1f090]{WAIT_DELETE_ACK}: Received Event DELETE_ACK (smscb_peer_fsm.c:423)
20220629104312596 DCBSP INFO SMSCB-PEER(TTCN-3-44-ttcn3)[0x560b46c1f770]{WAIT_DELETE_ACK}: state_chg to DELETED (smscb_peer_fsm.c:424)
20220629104327599 DCBSP INFO SMSCB(TTCN-3-44)[0x560b46c1f090]{WAIT_DELETE_ACK}: Timeout of T3 (fsm.c:317)
20220629104327599 DREST DEBUG rest_it_op_complete(op=0x7fd09c001490) complete (rest_it_op.c:129)
20220629104327599 DCBSP INFO SMSCB(TTCN-3-44)[0x560b46c1f090]{WAIT_DELETE_ACK}: state_chg to DELETED (smscb_message_fsm.c:294)
20220629104327599 DREST DEBUG rest_it_op completed with 0 (HTTP 0) (rest_it_op.c:68)
"""

Change-Id: Idb418728e1242fc5436355ccf73f20b1419e1eb8
---
M src/smscb_peer_fsm.c
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/smscb_peer_fsm.c b/src/smscb_peer_fsm.c
index 08b0f3f..21f17e6 100644
--- a/src/smscb_peer_fsm.c
+++ b/src/smscb_peer_fsm.c
@@ -419,9 +419,9 @@
/* append results */
msg_peer_append_cbsp_compl(mp, &dec->u.kill_compl.num_compl_list);
msg_peer_append_cbsp_cell(mp, &dec->u.kill_compl.cell_list);
+ osmo_fsm_inst_state_chg(fi, SMSCB_S_DELETED, 0, 0);
/* Signal parent fsm about completion */
osmo_fsm_inst_dispatch(fi->proc.parent, SMSCB_E_CBSP_DELETE_ACK, mp);
- osmo_fsm_inst_state_chg(fi, SMSCB_S_DELETED, 0, 0);
break;
case SMSCB_E_CBSP_DELETE_NACK:
dec = data;
@@ -429,9 +429,9 @@
msg_peer_append_cbsp_compl(mp, &dec->u.kill_fail.num_compl_list);
msg_peer_append_cbsp_cell(mp, &dec->u.kill_fail.cell_list);
msg_peer_append_cbsp_fail(mp, &dec->u.kill_fail.fail_list);
+ osmo_fsm_inst_state_chg(fi, SMSCB_S_DELETED, 0, 0);
/* Signal parent fsm about completion */
osmo_fsm_inst_dispatch(fi->proc.parent, SMSCB_E_CBSP_DELETE_NACK, mp);
- osmo_fsm_inst_state_chg(fi, SMSCB_S_DELETED, 0, 0);
break;
default:
OSMO_ASSERT(0);

To view, visit change 28496. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-cbc
Gerrit-Branch: master
Gerrit-Change-Id: Idb418728e1242fc5436355ccf73f20b1419e1eb8
Gerrit-Change-Number: 28496
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-MessageType: merged