<p>N A <strong>uploaded patch set #3</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18577">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_confbridge: Fix bridge shutdown race condition.<br><br>A race condition exists where if a bridge is left vacant<br>for a split instant, the bridge will shut down and go<br>away at the same instant that somebody else could be trying<br>to join it. The newcomer will find the conference still<br>in conference_bridges and thus take it and run with it.<br>At the same time, shutdown of the bridge completes and it<br>is removed from conference_bridges. This would generally<br>be rare since the timing must line up exactly right, but<br>if the timing is right, it can happen very frequently.<br><br>As a result, the newcomer will end up joining the bridge<br>corresponding to the original conference that is now<br>defunct. When the next party joins the same named bridge,<br>it won't be found in conference_bridges and thus a new<br>bridge gets created. This can happen right afterwards,<br>but in theory it could happen at any point after the first.<br><br>As a result, the newcomer that joined the bridge during<br>the shutdown ends up stranded in a bridge that isn't<br>known to app_confbridge anymore and will never get conferenced<br>with anything, since it's been removed from the list of<br>conferences already.<br><br>To prevent this, if the conference is empty when we try<br>to join it, we now clean it up then and there and then<br>make the new bridge immediately.<br><br>Additionally, we now check after we join the bridge<br>if the same conference object is returned when searching<br>for it. If it isn't, then we try to join the bridge again,<br>which will succeed the second time since we won't find<br>the shutting down conference anymore.<br><br>ASTERISK-30081 #close<br><br>Change-Id: I08a440eafbf83ec4b502d1e44c3f4d44c4a522f9<br>---<br>M apps/app_confbridge.c<br>1 file changed, 77 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/77/18577/3</pre><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: 3 </div>
<div style="display:none"> Gerrit-Owner: N A <asterisk@phreaknet.org> </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-Reviewer: N A <asterisk@phreaknet.org> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>