<p>George Joseph <strong>uploaded patch set #4</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15509">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_refer: Refactor progress locking and serialization<br><br>Although refer_progress_notify() always runs in the progress<br>serializer, the pjproject evsub module itself can cause the<br>subscription to be destroyed which then triggers<br>refer_progress_on_evsub_state() to clean it up. In this case,<br>it's possible that refer_progress_notify() could get the<br>subscription pulled out from under it while it's trying to use<br>it.<br><br>At one point we tried to have refer_progress_on_evsub_state()<br>push the cleanup to the serializer and wait for its return before<br>returning to pjproject but since pjproject calls its state<br>callbacks with the dialog locked, this required us to unlock the<br>dialog while waiting for the serialized cleanup, then lock it<br>again before returning to pjproject. There were also still some<br>cases where other callers of refer_progress_notify() weren't<br>using the serializer and crashes were resulting.<br><br>Although all callers of refer_progress_notify() now use the<br>progress serializer, we decided to simplify the locking so we<br>didn't have to unlock and relock the dialog in<br>refer_progress_on_evsub_state().<br><br>Now, refer_progress_notify() holds the dialog lock for its<br>duration and since pjproject also holds the dialog lock while<br>calling refer_progress_on_evsub_state() (which does the cleanup),<br>there should be no more chances for the subscription to be<br>cleaned up while still being used to send NOTIFYs.<br><br>ASTERISK-29313<br><br>Change-Id: I97a8bb01771a3c85345649b8124507f7622a8480<br>---<br>M res/res_pjsip_refer.c<br>1 file changed, 51 insertions(+), 56 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/09/15509/4</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15509">change 15509</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/+/15509"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: I97a8bb01771a3c85345649b8124507f7622a8480 </div>
<div style="display:none"> Gerrit-Change-Number: 15509 </div>
<div style="display:none"> Gerrit-PatchSet: 4 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.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-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>