[Asterisk-code-review] chan iax2: Prevent deadlock between hangup and sending lagrq... (asterisk[master])

Y Ateya asteriskteam at digium.com
Tue May 19 17:08:55 CDT 2015


Hello Richard Mudgett, Ashley Sanders, George Joseph,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/169

to look at the new patch set (#13).

Change subject: chan_iax2: Prevent deadlock between hangup and sending lagrq/ping
......................................................................

chan_iax2: Prevent deadlock between hangup and sending lagrq/ping

channels/chan_iax.c: Prevent the deadlock between iax2_hangup and send_lagrq/
send_ping. This deadlock happens because the scheduled task send_lagrq(or
send_ping) starts execution after the call hangup procedure starts but before
it deletes the tasks in the scheduler.

The solution is to delete scheduled lagrq (and ping) task asynchronously
(i.e. schedule AST_SCHED_DEL for these tasks); By this, AST_SCHED_DEL will
be called in a new context (doesn't have callno locked).

This commit also cleans up the procedure of sending LAGRQ and PING.

main/sched.c: Add ast_sched_del_if_exist which deletes entry from scheduler
if this entry exists.

ASTERISK-24983 #close
Reported by: Y Ateya

Change-Id: I03bec1fc8faacb89630269e935fa667c6d6c080c
---
M channels/chan_iax2.c
M include/asterisk/sched.h
M main/sched.c
3 files changed, 114 insertions(+), 46 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/69/169/13
-- 
To view, visit https://gerrit.asterisk.org/169
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I03bec1fc8faacb89630269e935fa667c6d6c080c
Gerrit-PatchSet: 13
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Y Ateya <y.ateya at starkbits.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Y Ateya <y.ateya at starkbits.com>



More information about the asterisk-code-review mailing list