summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_registration.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2018-03-29 17:07:56 -0500
committerRichard Mudgett <rmudgett@digium.com>2018-03-29 16:22:25 -0600
commit97cc67b12f1c5a0132e095b3e646c6014af554a0 (patch)
treec70a43a6ff92521cac48bd8b272b453a674dc9a2 /res/res_pjsip_outbound_registration.c
parent48ef239a01a7b5cacea822cbc4800f640e2dfad1 (diff)
res_pjsip: Fix deadlock on reliable transport shutdown.
A deadlock can happen when the PJSIP monitor thread is shutting down a connection oriented transport (TCP/TLS) used by a subscription at the same time as another thread tries to send something for that subscription. The deadlock is between the pjsip monitor thread attempting to get the dialog lock and another thread sending something for that dialog when it tries to get the transport manager lock. * res_pjsip_pubsub.c: Avoid the deadlock by pushing the subscription removal to the subscription serializer. * res_pjsip_registrar.c: Pushed off incoming registration contact removals to a default serializer as a precaution. Removing the contacts involves sorcery access which in this case will involve database access. Depending upon the setup, the database may not be on the same machine and could take awhile. We don't want to hold up the pjsip monitor thread with potentially long access times. ASTERISK-27706 Change-Id: I56b647aea565f24dba33e9e5ebeed4cd3f31f8c4
Diffstat (limited to 'res/res_pjsip_outbound_registration.c')
-rw-r--r--res/res_pjsip_outbound_registration.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_registration.c b/res/res_pjsip_outbound_registration.c
index d0f754604..011186321 100644
--- a/res/res_pjsip_outbound_registration.c
+++ b/res/res_pjsip_outbound_registration.c
@@ -833,6 +833,8 @@ static int reregister_immediately_cb(void *obj)
*
* \param obj What is needed to initiate a reregister attempt.
*
+ * \note Normally executed by the pjsip monitor thread.
+ *
* \return Nothing
*/
static void registration_transport_shutdown_cb(void *obj)