Change in ...osmo-ttcn3-hacks[master]: bts: Fix race condition in f_dyn_ipa_pdch_(de)act

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/.

pespin gerrit-no-reply at lists.osmocom.org
Tue Oct 8 11:18:51 UTC 2019


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15700


Change subject: bts: Fix race condition in f_dyn_ipa_pdch_(de)act
......................................................................

bts: Fix race condition in f_dyn_ipa_pdch_(de)act

Test BTS_Tests.TC_dyn_osmo_pdch_act_deact was sporadically failing due
to receiving IND_INFO on the PCU port with pdch_mask related TS bit set
to 0 after sending a PDCH ACT. That happened due to a race condition
because PCU send IND_INFO periodically. As a result, it can happen that
BTS sends an IND_INFO after PCU.clear was called and before the PDCH ACT
is handled.

Commit 446e07bc77ba2a1d08673cfeda6d4b6a72f49a77 already did same fix for
f_dyn_ipa_pdch_(de)act() family, but didn't change this one.

Change-Id: I323852632341c19837bebfcf2f00d404151367a7
---
M bts/BTS_Tests.ttcn
1 file changed, 18 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/00/15700/1

diff --git a/bts/BTS_Tests.ttcn b/bts/BTS_Tests.ttcn
index 2c11ca2..f2861d1 100644
--- a/bts/BTS_Tests.ttcn
+++ b/bts/BTS_Tests.ttcn
@@ -4899,13 +4899,21 @@
 	PCU.clear;
 	f_rsl_chan_act(g_pars.chan_mode);
 	/* expect INFO_IND on PCU interface listing TS as PDCH */
+	timer T_wait := 2.0;
+	T_wait.start;
 	alt {
 	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
 		if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '1'B) {
-			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "PCUIF_INFO_IND PDCH_MASK not '1' after PDCH ACT");
+			log("PCUIF_INFO_IND PDCH_MASK not yet '1' after PDCH ACT on TS", g_chan_nr.tn,
+			    " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
+			repeat;
 		}
 		}
 	[] PCU.receive { repeat; }
+	[] T_wait.timeout {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+			log2str("Timeout waiting for PCUIF_INFO_IND PDCH_MASK to be '1' on TS", g_chan_nr.tn));
+		}
 	}
 	/* try to activate this PDCH from the PCU point of view */
 	PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_ACT_REQ(bts_nr, trx_nr, g_chan_nr.tn)));
@@ -4919,13 +4927,21 @@
 	PCU.clear;
 	RSL.send(ts_RSL_RF_CHAN_REL(g_chan_nr));
 	/* expect BTS to ask PCU to deactivate the channel */
+	timer T_wait := 2.0;
+	T_wait.start;
 	alt {
 	[] PCU.receive(t_SD_PCUIF(pcu_conn_id, tr_PCUIF_INFO_IND(bts_nr, ?))) -> value sd {
 		if (substr(sd.data.u.info_ind.trx[trx_nr].pdch_mask, g_chan_nr.tn, 1) != '0'B) {
-			Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, "PCUIF_INFO_IND PDCH_MASK not '0' after PDCH DEACT");
+			log("PCUIF_INFO_IND PDCH_MASK not yet '0' after PDCH DEACT on TS", g_chan_nr.tn,
+			    " mask:", sd.data.u.info_ind.trx[trx_nr].pdch_mask);
+			repeat;
 		}
 		}
 	[] PCU.receive { repeat; }
+	[] T_wait.timeout {
+		Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail,
+			log2str("Timeout waiting for PCUIF_INFO_IND PDCH_MASK to be '0' on TS", g_chan_nr.tn));
+		}
 	}
 	/* Emulate PCU asking BTS to deactivate PDCH */
 	PCU.send(t_SD_PCUIF(pcu_conn_id, ts_PCUIF_DEACT_REQ(bts_nr, trx_nr, g_chan_nr.tn)));

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/15700
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I323852632341c19837bebfcf2f00d404151367a7
Gerrit-Change-Number: 15700
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191008/a7d642a1/attachment.htm>


More information about the gerrit-log mailing list