This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Neels Hofmeyr gerrit-no-reply at lists.osmocom.orgNeels Hofmeyr has submitted this change and it was merged.
Change subject: vlr_subscr_conn_timeout(): don't fire events to discarded fi
......................................................................
vlr_subscr_conn_timeout(): don't fire events to discarded fi
Terminating one of the FSM instances may effect termination and deallocation of
the others, as well as the vlr_subscr itself. So, reserve the vlr_subscr
locally, and then dispatch events to exactly those FSM instances that exist.
The changes in expected output in the msc_vlr_tests shows that the subscriber
was deallocated from the first FSM termination, and now sticks around until
we've checked both FSMs are gone.
Change-Id: I56551ecc10f5295fe75944bdde4b583b1b621811
---
M src/libvlr/vlr.c
M tests/msc_vlr/msc_vlr_test_hlr_timeout.err
M tests/msc_vlr/msc_vlr_test_ms_timeout.err
3 files changed, 21 insertions(+), 9 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
Holger Freyther: Looks good to me, but someone else must approve
diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c
index 4ef52da..59eb37d 100644
--- a/src/libvlr/vlr.c
+++ b/src/libvlr/vlr.c
@@ -973,8 +973,12 @@
if (!vsub)
return;
- vlr_loc_update_conn_timeout(vsub->lu_fsm);
- vlr_parq_conn_timeout(vsub->proc_arq_fsm);
+ vlr_subscr_get(vsub);
+ if (vsub->lu_fsm)
+ vlr_loc_update_conn_timeout(vsub->lu_fsm);
+ if (vsub->proc_arq_fsm)
+ vlr_parq_conn_timeout(vsub->proc_arq_fsm);
+ vlr_subscr_put(vsub);
}
struct vlr_instance *vlr_alloc(void *ctx, const struct vlr_ops *ops)
diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
index 4caaf1e..8ca2991 100644
--- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
+++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err
@@ -46,6 +46,7 @@
llist_count(&net->subscr_conns) == 1
- Total time passed: 5.001598 s
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
+DREF VLR subscr IMSI:901700000004620 usage increases to: 2
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Connection timed out
- sending LU Reject for IMSI:901700000004620, cause 22
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_DONE
@@ -67,10 +68,11 @@
- BSSAP Clear --RAN_GERAN_A--> MS
DREF IMSI:901700000004620: MSC conn use - 1 == 0
DRLL subscr IMSI:901700000004620: Freeing subscriber connection
-DREF VLR subscr IMSI:901700000004620 usage decreases to: 0
-DREF freeing VLR subscr IMSI:901700000004620
+DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
+DREF VLR subscr IMSI:901700000004620 usage decreases to: 0
+DREF freeing VLR subscr IMSI:901700000004620
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
bssap_clear_sent == 1
llist_count(&net->subscr_conns) == 0
@@ -146,6 +148,7 @@
lu_result_sent == 0
- Total time passed: 5.001598 s
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
+DREF VLR subscr MSISDN:46071 usage increases to: 2
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: Connection timed out
- sending LU Reject for MSISDN:46071, cause 22
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_HLR_UPD}: state_chg to VLR_ULA_S_DONE
@@ -167,10 +170,11 @@
- BSSAP Clear --RAN_GERAN_A--> MS
DREF MSISDN:46071: MSC conn use - 1 == 0
DRLL subscr MSISDN:46071: Freeing subscriber connection
-DREF VLR subscr MSISDN:46071 usage decreases to: 0
-DREF freeing VLR subscr MSISDN:46071
+DREF VLR subscr MSISDN:46071 usage decreases to: 1
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
+DREF VLR subscr MSISDN:46071 usage decreases to: 0
+DREF freeing VLR subscr MSISDN:46071
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
bssap_clear_sent == 1
llist_count(&net->subscr_conns) == 0
diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err
index 47af359..df34b86 100644
--- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err
+++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err
@@ -66,6 +66,7 @@
lu_result_sent == 0
- Total time passed: 5.001598 s
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
+DREF VLR subscr IMSI:901700000004620 usage increases to: 2
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Connection timed out
- sending LU Reject for IMSI:901700000004620, cause 22
DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_DONE
@@ -87,10 +88,11 @@
- BSSAP Clear --RAN_GERAN_A--> MS
DREF IMSI:901700000004620: MSC conn use - 1 == 0
DRLL subscr IMSI:901700000004620: Freeing subscriber connection
-DREF VLR subscr IMSI:901700000004620 usage decreases to: 0
-DREF freeing VLR subscr IMSI:901700000004620
+DREF VLR subscr IMSI:901700000004620 usage decreases to: 1
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
+DREF VLR subscr IMSI:901700000004620 usage decreases to: 0
+DREF freeing VLR subscr IMSI:901700000004620
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
bssap_clear_sent == 1
llist_count(&net->subscr_conns) == 0
@@ -298,6 +300,7 @@
cm_service_result_sent == 0
- Total time passed: 5.001598 s
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_NEW}: Timeout of T0
+DREF VLR subscr MSISDN:46071 usage increases to: 3
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Connection timed out
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: proc_arq_fsm_done(VLR_PR_ARQ_RES_TIMEOUT)
DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_DONE
@@ -320,9 +323,10 @@
- BSSAP Clear --RAN_GERAN_A--> MS
DREF MSISDN:46071: MSC conn use - 1 == 0
DRLL subscr MSISDN:46071: Freeing subscriber connection
-DREF VLR subscr MSISDN:46071 usage decreases to: 1
+DREF VLR subscr MSISDN:46071 usage decreases to: 2
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Freeing instance
DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_RELEASED}: Deallocated
+DREF VLR subscr MSISDN:46071 usage decreases to: 1
- SUBSCR_CONN_TIMEOUT has passed, conn is gone.
bssap_clear_sent == 1
llist_count(&net->subscr_conns) == 0
--
To view, visit https://gerrit.osmocom.org/4926
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I56551ecc10f5295fe75944bdde4b583b1b621811
Gerrit-PatchSet: 2
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>