<p>neels <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/18990">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  laforge: Looks good to me, but someone else must approve
  neels: Looks good to me, approved
  dexter: Looks good to me, but someone else must approve
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">sccp_simple_client: only restart ASP if it was created<br><br>In osmo_sccp_simple_client_on_ss7_id(), only call osmo_ss7_asp_restart() if the<br>ASP was created by that function. If a previously existing ASP was re-used, do<br>not restart it.<br><br>Background: Recently, osmo-bsc started calling<br>osmo_sccp_simple_client_on_ss7_id() multiple times, once for each configured<br>MSC in an MSC pool. Normally, that ends up re-using the same ASP and SCCP<br>client, so should not change anything.  Still, it turns out that the SCTP<br>association was re-launched for every configured MSC, which is obviously not<br>necessary when using the same SCCP connection and SCCP user for multiple MSCs.<br>That happened because osmo_sccp_simple_client_on_ss7_id() calls<br>osmo_ss7_asp_restart() even if a pre-existing ASP is re-used.<br><br>The rapid restarts also uncovered a problem in osmo-stp, causing it to crash --<br>that is a separate issue.<br><br>Independently from an osmo-stp fix, this change should in fact avoid the<br>osmo-stp crash and fix the sporadic massive ttcn3-bsc-test fallout we're seeing<br>since merging the MSC pooling feature to osmo-bsc.<br><br>Related: OS#4625<br>Change-Id: I62443edd681a2ec1b38f958520e907f9a7ef285e<br>---<br>M src/sccp_user.c<br>1 file changed, 9 insertions(+), 9 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/sccp_user.c b/src/sccp_user.c</span><br><span>index d8a7357..1278fae 100644</span><br><span>--- a/src/sccp_user.c</span><br><span>+++ b/src/sccp_user.c</span><br><span>@@ -597,16 +597,16 @@</span><br><span>                       talloc_free(asp_name);</span><br><span> </span><br><span>           osmo_ss7_as_add_asp(as, asp->cfg.name);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+          /* Ensure that the ASP we use is set to client mode. */</span><br><span style="color: hsl(120, 100%, 40%);">+               asp->cfg.is_server = false;</span><br><span style="color: hsl(120, 100%, 40%);">+                asp->cfg.role = OSMO_SS7_ASP_ROLE_ASP;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+           /* Restart ASP */</span><br><span style="color: hsl(120, 100%, 40%);">+             if (prot != OSMO_SS7_ASP_PROT_IPA)</span><br><span style="color: hsl(120, 100%, 40%);">+                    osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG);</span><br><span style="color: hsl(120, 100%, 40%);">+         osmo_ss7_asp_restart(asp);</span><br><span>   }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Ensure that the ASP we use is set to client mode. */</span><br><span style="color: hsl(0, 100%, 40%);">- asp->cfg.is_server = false;</span><br><span style="color: hsl(0, 100%, 40%);">-  asp->cfg.role = OSMO_SS7_ASP_ROLE_ASP;</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-       /* Restart ASP */</span><br><span style="color: hsl(0, 100%, 40%);">-       if (prot != OSMO_SS7_ASP_PROT_IPA)</span><br><span style="color: hsl(0, 100%, 40%);">-              osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG);</span><br><span style="color: hsl(0, 100%, 40%);">-   osmo_ss7_asp_restart(asp);</span><br><span>   LOGP(DLSCCP, LOGL_NOTICE, "%s: Using ASP instance %s\n", name,</span><br><span>          asp->cfg.name);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmo-sccp/+/18990">change 18990</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmo-sccp/+/18990"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmo-sccp </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I62443edd681a2ec1b38f958520e907f9a7ef285e </div>
<div style="display:none"> Gerrit-Change-Number: 18990 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Assignee: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: dexter <pmaier@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: neels <nhofmeyr@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>