summaryrefslogtreecommitdiff
path: root/res/res_pjsip.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2015-11-11 17:11:53 -0600
committerMark Michelson <mmichelson@digium.com>2015-11-12 11:39:41 -0500
commit264c74aa22aca7dffdf054ca1512a3638f3fc6dc (patch)
tree751ee9be5d225c76a5bbc341ad3ea9393929c149 /res/res_pjsip.c
parent469ad02404abeadd6f9594113e811a8840312f47 (diff)
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
Diffstat (limited to 'res/res_pjsip.c')
-rw-r--r--res/res_pjsip.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/res/res_pjsip.c b/res/res_pjsip.c
index cdaed4ee7..9d0540d42 100644
--- a/res/res_pjsip.c
+++ b/res/res_pjsip.c
@@ -3809,6 +3809,11 @@ static void remove_request_headers(pjsip_endpoint *endpt)
}
}
+long ast_sip_threadpool_queue_size(void)
+{
+ return ast_threadpool_queue_size(sip_threadpool);
+}
+
AST_TEST_DEFINE(xml_sanitization_end_null)
{
char sanitized[8];