[Asterisk-code-review] taskprocessor.c: Change when high water warning logged. (asterisk[14])
Joshua Colp
asteriskteam at digium.com
Mon Jan 16 12:40:43 CST 2017
Joshua Colp has submitted this change and it was merged. ( https://gerrit.asterisk.org/4721 )
Change subject: taskprocessor.c: Change when high water warning logged.
......................................................................
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
---
M main/taskprocessor.c
1 file changed, 3 insertions(+), 5 deletions(-)
Approvals:
George Joseph: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index ceb5f5c..4ccd48e 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -884,12 +884,10 @@
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);
}
--
To view, visit https://gerrit.asterisk.org/4721
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Iabf75a004f7edaf1e5e8c323099418e667cac999
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
More information about the asterisk-code-review
mailing list