Change in osmo-msc[master]: vty: show subscriber: put() before printing the use count

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.org
Wed Dec 12 11:33:01 UTC 2018


Neels Hofmeyr has posted comments on this change. ( https://gerrit.osmocom.org/12266 )

Change subject: vty: show subscriber: put() before printing the use count
......................................................................


Patch Set 1:

> looks a bit like a hack and rely on not-really-always-guaranteed-behavior.  I guess the cleaner way would be to tell the printing function to subtract one..

I thought about that, but then also the 'show subscriber cache' iterates subscribers without get()ting them. And, since this is not multithreaded, there actually is no way how a subscriber can exist before this invocation and then be discarded by the put(). By definition we only find subscribers with a use count initially >= 1, and this count cannot decrease externally while the vty command is running. right?

Instead, printing a use count that is not actually there is IMHO the hacky solution. Thinking if we might at some point add a used-by bitflag like for ran_conn, then we'd have to hack around in that, too...

I guess the least hacky is to always get() and put() and expect a use count of 2 on the vty output. Yet ... the single-threaded-there-is-no-way-to-lose-the-vsub argument makes sense to me. Further opinions welcome...


-- 
To view, visit https://gerrit.osmocom.org/12266
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id02b57b7ed299b010b9f8b9e809548eb1e6aa699
Gerrit-Change-Number: 12266
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-CC: Harald Welte <laforge at gnumonks.org>
Gerrit-Comment-Date: Wed, 12 Dec 2018 11:33:01 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181212/83c1aeca/attachment.htm>


More information about the gerrit-log mailing list