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

Review request for Asterisk Developers.


Bugs: https://issues.asterisk.org/jira/browse/ASTERISK-23547
    
https://issues.asterisk.org/jira/browse/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

-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to