<p> Attention is currently required from: Joshua Colp, N A. </p>
<p><a href="https://gerrit.asterisk.org/c/asterisk/+/18891">View Change</a></p><p>1 comment:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_pubsub.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/+/18891/comment/9aa37d47_8c12ea99">Patch Set #2, Line 4084:</a> <code style="font-family:monospace,monospace"> if (ast_sip_push_task(sub_tree->serializer, destroy_subscriptions_task, old_root)) {</code></p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;">Under what case would this not already be executing under the serializer of the sub_tree? The dialog […]</blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is RLS update which happens in pubsub_on_rx_refresh.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I could not find that pubsub_on_rx_refresh is executed by sub_tree->serializer.<br>But I had the sigfaults in res_pjsip_exten_state.c:notify_task <br>a few times after RLS was updated.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I thought the following happened:<br>The asterisk checked if there were changes to the list on the subscriptions refresh<br>by generating a new ast_sip_subscription tree and comparing with old ast_sip_subscription tree.<br>There was difference and the asterisk replaced root with new tree and destroyed old tree.<br>At the same time when the old tree was destroying the res_pjsip_exten_state.c:notify_task was executing by sub_tree->serializer and part of data (datastore) was already destroyed.<br>The sigfault was in ast_datastores_find which is called by res_pjsip_dialog_info_body_generator.</p><p style="white-space: pre-wrap; word-wrap: break-word;">So I thought that pubsub_on_rx_refresh was not executed by sub_tree->serializer.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Since I implemented this fix, I have not seen any more sigfaults on RLS update.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Maybe it's not because I put the destruction task into the serializer, but because set_state_terminated(old_root) is called before the destruction task.</p><p style="white-space: pre-wrap; word-wrap: break-word;">If you are sure that pubsub_on_rx_refresh is executed by sub_tree->serializer,<br>I'll remove ast_sip_push_task and leave only set_state_terminated(old_root).</p><p style="white-space: pre-wrap; word-wrap: break-word;">What do you think?</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18891">change 18891</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/+/18891"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I96582aad3a26515ca73a8460ee6756f56f6ba23b </div>
<div style="display:none"> Gerrit-Change-Number: 18891 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Alexei Gradinari <alex2grad@gmail.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: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: N A <mail@interlinked.x10host.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 16 Aug 2022 14:51:51 +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>