summaryrefslogtreecommitdiff
path: root/main/taskprocessor.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2017-01-13 21:23:49 -0600
committerRichard Mudgett <rmudgett@digium.com>2017-01-13 21:30:53 -0600
commit473330983b47618772b1dd414df8e063e5da6a53 (patch)
treed89369002f01a74a02e0e5897370132fe3983ba3 /main/taskprocessor.c
parentb9c73de158b4498c0bdec1d29ee1b517e5ef27a9 (diff)
taskprocessor.c: Change when high water warning logged.
The task processor queue reached X scheduled tasks message was originally intended to get logged only once per task processor to prevent spamming the log. This is no longer necessary since high and low water thresholds can better control when the message is logged. It is beneficial to generate the warning each time a task processor reaches the high water level because PJSIP stops processing new requests while any high water alert is active. Without this change you would have to enable at least debug level 3 logging to know about a repeated alert trigger. * Made generate the warning message whenever a task is pushed into the task processor that triggers the high water alert. * Appended 'again' to the warning for a repeated high water alert trigger. Change-Id: Iabf75a004f7edaf1e5e8c323099418e667cac999
Diffstat (limited to 'main/taskprocessor.c')
-rw-r--r--main/taskprocessor.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index bbf282c27..f4ebab3c0 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -884,12 +884,10 @@ static int taskprocessor_push(struct ast_taskprocessor *tps, struct tps_task *t)
previous_size = tps->tps_queue_size++;
if (tps->tps_queue_high <= tps->tps_queue_size) {
- if (!tps->high_water_warned) {
- tps->high_water_warned = 1;
- ast_log(LOG_WARNING, "The '%s' task processor queue reached %ld scheduled tasks.\n",
- tps->name, tps->tps_queue_size);
- }
if (!tps->high_water_alert) {
+ ast_log(LOG_WARNING, "The '%s' task processor queue reached %ld scheduled tasks%s.\n",
+ tps->name, tps->tps_queue_size, tps->high_water_warned ? " again" : "");
+ tps->high_water_warned = 1;
tps->high_water_alert = 1;
tps_alert_add(tps, +1);
}