summaryrefslogtreecommitdiff
path: root/main/taskprocessor.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2015-11-13 14:19:35 -0600
committerMark Michelson <mmichelson@digium.com>2015-11-13 14:19:35 -0600
commite8881e177046422690d2e87417a93b253469c379 (patch)
treed3aab1a43860805cbbe670c516d7f7a05391e0f2 /main/taskprocessor.c
parent40b58a5d2b2acddc8ff616b4c0fbdc808e16a9da (diff)
Taskprocessors: Increase high-water mark
In practical tests, we have seen certain taskprocessors, specifically Stasis subscription taskprocessors, cross the recently-added high-water mark and emit a warning. This high-water mark warning is only intended to be emitted when things have tanked on the system and things are heading south quickly. In the practical tests, the Stasis taskprocessors sometimes had a max depth of 180 tasks in them, and Asterisk wasn't in any danger at all. As such, this ups the high-water mark to 500 tasks instead. It also redefines the SIP threadpool request denial number to be a multiple of the taskprocessor high-water mark. Change-Id: Ic8d3e9497452fecd768ac427bb6f58aa616eebce
Diffstat (limited to 'main/taskprocessor.c')
-rw-r--r--main/taskprocessor.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index 91125ad2a..dfead22ab 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -713,8 +713,6 @@ void *ast_taskprocessor_unreference(struct ast_taskprocessor *tps)
return NULL;
}
-#define HIGH_WATER_LEVEL 100
-
/* push the task into the taskprocessor queue */
static int taskprocessor_push(struct ast_taskprocessor *tps, struct tps_task *t)
{
@@ -735,7 +733,7 @@ static int taskprocessor_push(struct ast_taskprocessor *tps, struct tps_task *t)
AST_LIST_INSERT_TAIL(&tps->tps_queue, t, list);
previous_size = tps->tps_queue_size++;
- if (previous_size >= HIGH_WATER_LEVEL && !tps->high_water_warned) {
+ if (previous_size >= AST_TASKPROCESSOR_HIGH_WATER_LEVEL && !tps->high_water_warned) {
ast_log(LOG_WARNING, "The '%s' task processor queue reached %d scheduled tasks.\n",
tps->name, previous_size);
tps->high_water_warned = 1;