summaryrefslogtreecommitdiff
path: root/include/asterisk
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2015-10-21 13:44:17 -0300
committerJoshua Colp <jcolp@digium.com>2015-10-21 14:26:53 -0300
commitf2725c8b77f6e6d6b70c12c4e57e26083530c3be (patch)
tree297a90b54666d8d04b35ed48937a8fcb475cb7f4 /include/asterisk
parent7c560a9a31ce93ae35ac80ca7f098929fbc5c6d5 (diff)
res_pjsip: Move URI validation to use time.
In a realtime based system with a limited number of threadpool threads it is possible for a deadlock to occur. This happens when permanent endpoint state is updated, which will cause database queries to be done. These queries may result in URI validation being done which is done synchronously using a PJSIP thread. If all PJSIP threads are in use processing traffic they themselves may be blocked waiting to get the permanent endpoint container lock when identifying an endpoint. This change moves URI validation to occur at use time instead of configuration time. While this comes at a cost of not seeing a problem until you use it it does solve the underlying deadlock problem. ASTERISK-25486 #close Change-Id: I2d7d167af987d23b3e8199e4a68f3359eba4c76a
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/res_pjsip.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/asterisk/res_pjsip.h b/include/asterisk/res_pjsip.h
index a36935dd3..459082901 100644
--- a/include/asterisk/res_pjsip.h
+++ b/include/asterisk/res_pjsip.h
@@ -1190,6 +1190,11 @@ int ast_sip_push_task(struct ast_taskprocessor *serializer, int (*sip_task)(void
* cause a deadlock. If you are in a SIP servant thread, just call your function
* in-line.
*
+ * \warning \b Never hold locks that may be acquired by a SIP servant thread when
+ * calling this function. Doing so may cause a deadlock if all SIP servant threads
+ * are blocked waiting to acquire the lock while the thread holding the lock is
+ * waiting for a free SIP servant thread.
+ *
* \param serializer The SIP serializer to which the task belongs. May be NULL.
* \param sip_task The task to execute
* \param task_data The parameter to pass to the task when it executes