osmo-msc[master]: trans_free: tear down conn when last transaction is done

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
Thu Mar 15 18:43:10 UTC 2018


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/7303/1/src/libmsc/transaction.c
File src/libmsc/transaction.c:

PS1, Line 155: msc_subscr_conn_put
> What I'm surprised is why the msc_subscr_conn_put() is not sufficient here.
Hmm, might do the subscr_conn_release_when_unused() call in msc_subscr_conn_put(). But not really:

The ref count is for deallocation of the gsm_subscriber_connection struct. The FSM is another layer on top.

While establishing l3, the compl_l3 rx code is holding a ref count on the conn, and then either the FSM gets established and adds another ref count, or once the l3 rx is through and reduces the ref count, the allocated gsm_subscriber_connection struct gets deallocated right away.

So, the conn fsm is also holding one of these ref counts, and often the fsm is the only one referencing the conn: e.g. when we've received a CM Service Request and auth is through, but we're still waiting for an actual service request from the MS, in which case we still want to stay open. Only the FSM knows whether we still want to do some communication before deallocation.

Thinking it over again, at this point in the code there will always be an FSM holding a ref count on the conn, and the trans itself can unreference its conn pointer, but still needs to ask the FSM whether it is ready to also release its reference.

>From what I've just said, having a ref count in the trans is actually redundant, because a trans will only be present while a conn fsm is also present. But I guess it's still a good thing to count each and every conn reference everywhere despite redundancy.


-- 
To view, visit https://gerrit.osmocom.org/7303
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I46ff2e9b09b67e4e0d79cccf8c04936f17281fcb
Gerrit-PatchSet: 1
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: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list