[asterisk-dev] [Code Review] 3404: app_queue removing callers from queue when reloading

Italo Rossi reviewboard at asterisk.org
Tue Apr 1 11:48:59 CDT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3404/
-----------------------------------------------------------

(Updated April 1, 2014, 11:48 a.m.)


Status
------

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
-------

Committed in revision 411584


Bugs: ASTERISK-23547
    https://issues.asterisk.org/jira/browse/ASTERISK-23547


Repository: Asterisk


Description
-------

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.


Diffs
-----

  /branches/1.8/apps/app_queue.c 411294 

Diff: https://reviewboard.asterisk.org/r/3404/diff/


Testing
-------

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.


Thanks,

Italo Rossi

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140401/5894c60b/attachment.html>


More information about the asterisk-dev mailing list