res_pjsip: Deny requests when threadpool queue is backed up.
authorMark Michelson <mmichelson@digium.com>
Wed, 11 Nov 2015 23:11:53 +0000 (17:11 -0600)
committerMark Michelson <mmichelson@digium.com>
Thu, 12 Nov 2015 16:39:41 +0000 (11:39 -0500)
commit264c74aa22aca7dffdf054ca1512a3638f3fc6dc
tree751ee9be5d225c76a5bbc341ad3ea9393929c149
parent469ad02404abeadd6f9594113e811a8840312f47
res_pjsip: Deny requests when threadpool queue is backed up.

We have observed situations where the SIP threadpool may become
deadlocked. However, because incoming traffic is still arriving, the SIP
threadpool's queue can continue to grow, eventually running the system
out of memory.

This change makes it so that incoming traffic gets rejected with a 503
response if the queue is backed up too much.

Change-Id: I4e736d48a2ba79fd1f8056c0dcd330e38e6a3816
include/asterisk/res_pjsip.h
include/asterisk/taskprocessor.h
include/asterisk/threadpool.h
main/taskprocessor.c
main/threadpool.c
res/res_pjsip.c
res/res_pjsip/pjsip_distributor.c