]> git.ipfire.org Git - thirdparty/asterisk.git/commit
res_pjsip: Move URI validation to use time. 71/1471/1
authorJoshua Colp <jcolp@digium.com>
Wed, 21 Oct 2015 16:44:17 +0000 (13:44 -0300)
committerJoshua Colp <jcolp@digium.com>
Wed, 21 Oct 2015 17:36:16 +0000 (12:36 -0500)
commit43323995baf2777f91f03874fa0b39fac5f680c0
tree33911603b73a449766225ff874064d0ca8c9865e
parentb5cfcfc427238c2a42f5fbfc758e18ebf8dfc04a
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
include/asterisk/res_pjsip.h
res/res_pjsip.c
res/res_pjsip/location.c
res/res_pjsip/pjsip_configuration.c