]> git.ipfire.org Git - thirdparty/asterisk.git/commit
Fix potential deadlock situation in res_pjsip.
authorMark Michelson <mmichelson@digium.com>
Thu, 12 Jun 2014 14:03:52 +0000 (14:03 +0000)
committerMark Michelson <mmichelson@digium.com>
Thu, 12 Jun 2014 14:03:52 +0000 (14:03 +0000)
commitceef709d48aab43c6ea35de65cfc5fc2d1fd357d
treedb36328725158d9f6642376b70d4049c2292e0cd
parent197505339d71df53be33a2c6f2b7936333f5c25e
Fix potential deadlock situation in res_pjsip.

SIP transaction timeouts are handled in the PJSIP monitor thread. When
this happens on a subscription, and the subscription is destroyed, the
subscription destruction is dispatched synchronously to the threadpool.
The issue is that the PJSIP dialog is locked by the monitor thread,
and then the dispatched task attempts to lock the dialog. This leads
to a deadlock that causes SIP traffic to no longer be accepted on the
Asterisk server.

The fix here is to treat the monitor thread as if it were a threadpool
thread when it attempts to dispatch synchronous tasks. This way, the
dispatched task turns into a simple function call within the same thread,
and the locking issue is averted.

AST-2014-008

ASTERISK-23802 #close

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@415794 65c4cc65-6c06-0410-ace0-fbb531ad65f3
res/res_pjsip.c