<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/3404/">https://reviewboard.asterisk.org/r/3404/</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.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Italo Rossi.</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/https://issues.asterisk.org/jira/browse/ASTERISK-23547">https://issues.asterisk.org/jira/browse/ASTERISK-23547</a>
</div>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</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;">If you have only realtime members in queue 'sales', for example, and callers are waiting on this queue, when you do 'module reload app_queue.so' all the callers will be removed with EXITEMPTY reason.
The problem is when we reload app_queue, the function:
static int mark_member_dead(void *obj, void *arg, int flags)
{
struct member *member = obj;
if (!member->dynamic) {
member->delme = 1;
}
return 0;
}
is called and mark the static AND REALTIME members as dead.
At the same time, the remaining callers on queue are checking if there are available members through the function get_member_status. This functions iterate over all members of the queue and will return 0 if there are available members, or -1 if there's no members available.
If you have one realtime member with status inuse and the queue is configured with leavewhenempty=penalty,invalid, for example, the callers will join this queue and will keep waiting for an available member.
Before the reload, the get_member_status will always return 0, because there is one available member with status inuse, but when you reload the app_queue.so, the realtime member will be removed by mark_member_dead (and kill_dead_members) function and the callers waiting on queue will leave with reason EXITEMPTY because get_member_status doesn't iterate over members (there's no members at this time) and returns -1.
</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;">I've tested the main operations:
adding/removing dynamic members
adding/removing static members
adding/removing realtime members
All worked.
Tested reloading module with calls waiting on queues, all worked.</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>/branches/1.8/apps/app_queue.c <span style="color: grey">(411294)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/3404/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>