<p>Patch set 1:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/10486">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10486/1/apps/app_confbridge.c">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/10486/1/apps/app_confbridge.c@1115">Patch Set #1, Line 1115:</a> <code style="font-family:monospace,monospace"> /* BUGBUG: how should we handle ast_taskprocess_push failure here? */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I don't think there is anything we can do other than not hanging up the playback channel.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10486/1/main/stasis.c">File main/stasis.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/10486/1/main/stasis.c@565">Patch Set #1, Line 565:</a> <code style="font-family:monospace,monospace"> /* BUGBUG: how do we handle this? */</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">I do not think there is anything we can do that is not likely to cause a crash.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10486/1/main/taskprocessor.c">File main/taskprocessor.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/10486/1/main/taskprocessor.c@238">Patch Set #1, Line 238:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (ast_taskprocessor_push(listener->tps, default_listener_die, pvt)) {<br> /* BUGBUG: what do we do here? */<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">On failure I think we can just:</p><p style="white-space: pre-wrap; word-wrap: break-word;">default_listener_die(pvt);</p><p style="white-space: pre-wrap; word-wrap: break-word;">This will cause the thread to exit early and not complete the tasks already in the queue.</p><p style="white-space: pre-wrap; word-wrap: break-word;">Another way to handle this is to take the pthread_detach() path below.</p><p style="white-space: pre-wrap; word-wrap: break-word;">I think making the thread exit early is the better of the bad choices. At least the taskprocessor will clean up.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10486/1/main/threadpool.c">File main/threadpool.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/10486/1/main/threadpool.c@661">Patch Set #1, Line 661:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> if (ast_taskprocessor_push(pool->control_tps, queued_emptied, pool)) {<br> ast_log(LOG_ERROR, "Failed to push call, leaks may occur.\n");<br> }<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">We don't need to do anything on failure as the callback isn't currently used by anything.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/#/c/10486/1/tests/test_threadpool.c">File tests/test_threadpool.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/10486/1/tests/test_threadpool.c@333">Patch Set #1, Line 333:</a> <code style="font-family:monospace,monospace"> ast_free(std);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Heh. std isn't destroyed right. We need to destroy the lock and cond initialized by simple_task_data_alloc().</p><p style="white-space: pre-wrap; word-wrap: break-word;">This is true for all cleanups of std in the tests in this file.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/#/c/10486/1/tests/test_threadpool.c@1434">Patch Set #1, Line 1434:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;"> ctd1 = complex_task_data_alloc();<br> ctd2 = complex_task_data_alloc();<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">ctd1 and ctd2 are not cleaned up properly. Just like for simple_task_data_alloc() the lock and conds initialized are not destroyed.</p><p style="white-space: pre-wrap; word-wrap: break-word;">This is true for tests in this file that have them.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/10486">change 10486</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/10486"/><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-MessageType: comment </div>
<div style="display:none"> Gerrit-Change-Id: I7e4079bd7b21cfe52fb431ea79e41314520c3f6d </div>
<div style="display:none"> Gerrit-Change-Number: 10486 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 (1000185) </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 16 Oct 2018 23:19:13 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-HasLabels: Yes </div>