<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/2749/">https://reviewboard.asterisk.org/r/2749/</a>
</td>
</tr>
</table>
<br />
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers and David Lee.</div>
<div>By Matt Jordan.</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
testsuite
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The Asterisk stop sequence was a tad complex. It would:
* Perform a core stop gracefully with a total of 5 retries
* Perform a core stop now with a total of 5 retries
* Send a TERM
* Send a KILL
This actually was counterproductive for a few reasons:
1. Once Asterisk has initiated a shutdown sequence, it will refuse any subsequent shutdown attempts. Thus, once the first 'core stop gracefully' is received, any further 'core stop gracefully' attempts or 'core stop now' attempts will be rejected. Furthermore, a 'core stop gracefully' will return success - even if the process doesn't exist - as Asterisk will pretty much always accept an attempt to shutdown from the Test Suite. So the retries/core stop now sequence actually did nothing.
2. If we don't stop gracefully, for whatever reason, we either have to wait indefinitely or we have to kill the process. There isn't anything else to be done.
This patch does the following:
1. It sends a core stop gracefully. If that fails, a scheduled KILL will eventually terminate the process.
2. It adds some additional checks to verify if the process is actually still running before starting the shutdown sequence. This should more gracefully handle conditions when Asterisk crashes or otherwise prematurely exits.
3. It stops consuming errors in the DeferredList of stop deferred callbacks. If one of them throws an exception, we'll crash out. This helps prevent situations where an exception in a stop deferred callback causes the chain of deferreds to stop and hang the test.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">A number of tests that hung the Test Suite now finish to conclusion (and their failure)</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/asterisk/trunk/lib/python/asterisk/asterisk.py <span style="color: grey">(4000)</span></li>
<li>/asterisk/trunk/lib/python/asterisk/TestCase.py <span style="color: grey">(4000)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/2749/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>