https://osmocom.org/https://osmocom.org/favicon.ico?16647414092018-02-09T11:40:03ZOpen Source Mobile Communicationslibosmocore - Bug #2915: FSM: Do not terminate child FSMs earlyhttps://osmocom.org/issues/2915?journal_id=75572018-02-09T11:40:03Zdexter
<ul></ul><p>Also checked (just to be sure) the unit-tests of:</p>
<p>osmo-iuh<br />osmo-sgsn<br />libosmo-netif <br />osmo-bsc<br />libosmo-sccp<br />osmo-hlr</p>
<p>No problems detected there so far.</p> libosmocore - Bug #2915: FSM: Do not terminate child FSMs earlyhttps://osmocom.org/issues/2915?journal_id=76362018-02-14T17:47:48Zdexter
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li></ul><p>I have analyzed the problem further, even when the change seems not to cause any harm to osmo-msc, osmo-stp and other users of OSMO-FSM we should opt against the patch since it drastically changes the behavior on how OSMO-FSMs are terminated.</p>
<p>The FSM childs are freed first on a termination. This models a recursion where the cleanup callbacks run from the leaf child to the parent. The call traverses recursively to the very end of the FSM tree and starts terminating everything from the back. When the last child is terminated the call returns, to the above child until it arrives at the parent FSM. I assume that this is a well thought out paradigm of OSMO-FSM and should not be changed.</p>
<p>When we move the callback that terminates the childs after the cleanup callback. Then the first cleanup callback that runs is the one of the child next to the parent. From there the calls traverse down to the end until they reach the leaf child. So the direction changes to the opposite.</p>
<p>My idea to come around this is to introduce a grace (graceful exit) callback that runs on the beginning of each termination before the termination even starts.</p>
<p>See also: <a class="external" href="https://gerrit.osmocom.org/#/c/6452/">https://gerrit.osmocom.org/#/c/6452/</a></p> libosmocore - Bug #2915: FSM: Do not terminate child FSMs earlyhttps://osmocom.org/issues/2915?journal_id=76412018-02-14T19:00:10Zlaforge
<ul></ul><p>Hi Philipp,</p>
<p>On Wed, Feb 14, 2018 at 05:47:48PM +0000, dexter [REDMINE] wrote:</p>
<blockquote>
<p>The FSM childs are freed first on a termination. This models a recursion where the cleanup callbacks run from the leaf child to the parent. The call traverses recursively to the very end of the FSM tree and starts terminating everything from the back. When the last child is terminated the call returns, to the above child until it arrives at the parent FSM. I assume that this is a well thought out paradigm of OSMO-FSM and should not be changed.</p>
</blockquote>
<p>you give me more credit than I think I deserve ;) not sure if I had that<br />specifically in mind when designing the osmo_fsm code, or whether it was<br />simply the "natural, intuitive choice". But yes, I agree with your<br />analysis and I think it should be preserved.</p> libosmocore - Bug #2915: FSM: Do not terminate child FSMs earlyhttps://osmocom.org/issues/2915?journal_id=76972018-02-19T20:56:50Zdexter
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li></ul>