<p> Attention is currently required from: Joshua Colp. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/18577">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File apps/app_confbridge.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18577/comment/e127970e_4dd8bca6">Patch Set #1, Line 1742:</a> <code style="font-family:monospace,monospace">    conference = ao2_find(conference_bridges, conference_name, OBJ_KEY);</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">The underlying issue here is that the conference bridge has transitioned to empty and another thread […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think I follow this logic except for one caveat: what about the case where the conference is *not* empty when we find it here, but becomes empty in the middle here before we actually join it (that is, by the time we execute that other code you commented on, it becomes empty and is then cleaned up).<br>This seems like another potential race condition to me, just in a different way/place - or did I miss something else?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18577/comment/61c11870_ad1abf60">Patch Set #1, Line 1906:</a> <code style="font-family:monospace,monospace">  /* Rare, but if threads interleave exactly right, the bridge could disappear</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">I don't think this is a complete fix. […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the code at this point is foolproof, because this is the point where we try to enter the bridge, with the entire lock held, so if we detect that it disappeared on us, we can remediate it at this point.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think the larger issue here is not that the code might not work, but the fact that the code is even needed in the first place - it does feel somewhat hacky to have code effectively like "do A" (which should always succeeded, in theory), and then "if A failed, let's make sure A succeeded by doing B".</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/18577/comment/19c5fa55_9ffe69f8">Patch Set #1, Line 1915:</a> <code style="font-family:monospace,monospace">                       conference->bridge, conference2 ? "changed" : "disappeared");</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">It's not possible for conference->bridge to be NULL here.</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">The ternary is on conference2 which could be NULL.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18577">change 18577</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.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.asterisk.org/c/asterisk/+/18577"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I08a440eafbf83ec4b502d1e44c3f4d44c4a522f9 </div>
<div style="display:none"> Gerrit-Change-Number: 18577 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Sat, 06 Aug 2022 20:24:41 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: No </div>
<div style="display:none"> Comment-In-Reply-To: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-MessageType: comment </div>