<p>N A has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18523">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">cli: Prevent assertions on startup from bad ao2 refs.<br><br>If "core show channels" is run before startup has completed, it<br>is possible for bad ao2 refs to occur because the system is not<br>yet fully initialized. This will lead to an assertion failing.<br><br>To prevent this, we now sleep and wait for Asterisk to be fully<br>booted before any channel container access is attempted.<br><br>ASTERISK-29846 #close<br><br>Change-Id: If6b3cde802876bd738c1b4cf2683bea6ddc615b6<br>---<br>M main/cli.c<br>1 file changed, 5 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/23/18523/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/main/cli.c b/main/cli.c</span><br><span>index 0c11953..2dc8820 100644</span><br><span>--- a/main/cli.c</span><br><span>+++ b/main/cli.c</span><br><span>@@ -1139,6 +1139,11 @@</span><br><span>         } else if (a->argc != e->args - 1)</span><br><span>             return CLI_SHOWUSAGE;</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+     /* Don't attempt to iterate channels if startup is not complete. */</span><br><span style="color: hsl(120, 100%, 40%);">+       while (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {</span><br><span style="color: hsl(120, 100%, 40%);">+         usleep(1000);</span><br><span style="color: hsl(120, 100%, 40%);">+ }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span>  channels = ast_channel_cache_by_name();</span><br><span> </span><br><span>  if (!count) {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18523">change 18523</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/+/18523"/><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: If6b3cde802876bd738c1b4cf2683bea6ddc615b6 </div>
<div style="display:none"> Gerrit-Change-Number: 18523 </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-MessageType: newchange </div>