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 <nhofm...@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Neels Hofmeyr <nhofm...@sysmocom.de>
Gerrit-CC: Harald Welte <lafo...@gnumonks.org>
Gerrit-Comment-Date: Wed, 12 Dec 2018 11:33:01 +0000
Gerrit-HasComments: No
Gerrit-HasLabels: No

Reply via email to