Change in osmo-gsm-tester[master]: OsmoCtrl: use one global common counter for CTRL IDs

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 gerrit-no-reply at lists.osmocom.org
Sun Dec 6 22:24:47 UTC 2020


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21567 )


Change subject: OsmoCtrl: use one global common counter for CTRL IDs
......................................................................

OsmoCtrl: use one global common counter for CTRL IDs

It is easier to traverse debugging logs if the CTRL request and response
IDs are globally unique across all programs and tests. Before this, we
were using 0 almost everywhere.

(This is not strictly needed for correctness, since each CTRL client has
its own request ID scope; just we open fairly many separate CTRL clients
all the time in our tests.)

Change-Id: I44c51f4fb5beb6cedf98ea0d6684a24c6aa418c7
---
M src/osmo_gsm_tester/obj/osmo_ctrl.py
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/67/21567/1

diff --git a/src/osmo_gsm_tester/obj/osmo_ctrl.py b/src/osmo_gsm_tester/obj/osmo_ctrl.py
index 56167c3..0ea6a2c 100644
--- a/src/osmo_gsm_tester/obj/osmo_ctrl.py
+++ b/src/osmo_gsm_tester/obj/osmo_ctrl.py
@@ -38,17 +38,17 @@
     pass
 
 class OsmoCtrl(log.Origin):
+    _next_id = 1
 
     def __init__(self, host, port):
         super().__init__(log.C_BUS, 'Ctrl', host=host, port=port)
         self.host = host
         self.port = port
         self.sck = None
-        self._next_id = 0
 
     def next_id(self):
-        ret = self._next_id
-        self._next_id += 1
+        ret = OsmoCtrl._next_id
+        OsmoCtrl._next_id += 1
         return ret
 
     def prefix_ipa_ctrl_header(self, data):

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-tester/+/21567
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Change-Id: I44c51f4fb5beb6cedf98ea0d6684a24c6aa418c7
Gerrit-Change-Number: 21567
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201206/01552e0a/attachment.htm>


More information about the gerrit-log mailing list