[asterisk-dev] [Code Review] Asterisk 1.8 Deadlock in app_queue

irroot reviewboard at asterisk.org
Sat Sep 10 14:43:24 CDT 2011


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

(Updated Sept. 10, 2011, 2:43 p.m.)


Review request for Asterisk Developers and Matthew Nicholson.


Changes
-------

hi there there is no need to call ao2_lock(queues) / ao2_unlock(queues) outside of the ao2 functions as they handle the container locking.

app_queue MUST never lock a channel with the queues container lock held this will lead to these deadlocks on masquerade / transfer the call to ao2_lock(queues) in try_calling will deadlock with update_queues in try_calling and the fixup routine the first instance has been fixed by mnicholson [added to this review due to this]

the latest patch removes all calls to ao2_[un]lock(queues) that are double locks. 


Summary
-------

Locking order with queues container.

1)the queues container is locked when calling channels this causes a deadlock and is unneeded.
2)lock the queues container when running queue_update to maintain correct locking order.


This addresses bug ASTERISK-18101.
    https://issues.asterisk.org/jira/browse/ASTERISK-18101


Diffs (updated)
-----

  /branches/1.8/apps/app_queue.c 335124 

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


Testing
-------


Thanks,

irroot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20110910/cd1ef404/attachment.htm>


More information about the asterisk-dev mailing list