[asterisk-commits] taskprocessor.c: Tweak high water checks. (asterisk[13])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 11 22:31:24 CDT 2016
Anonymous Coward #1000019 has submitted this change and it was merged.
Change subject: taskprocessor.c: Tweak high water checks.
......................................................................
taskprocessor.c: Tweak high water checks.
* The high water check in ast_taskprocessor_alert_set_levels() would
trigger immediately if the new high water level is zero and the queue was
empty.
* The high water check in taskprocessor_push() was off by one.
Change-Id: I687729fb4efa6a0ba38ec9c1c133c4d407bc3d5d
---
M main/taskprocessor.c
1 file changed, 4 insertions(+), 4 deletions(-)
Approvals:
Mark Michelson: Looks good to me, approved
Anonymous Coward #1000019: Verified
Matt Jordan: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
diff --git a/main/taskprocessor.c b/main/taskprocessor.c
index 0c429cf..bbf282c 100644
--- a/main/taskprocessor.c
+++ b/main/taskprocessor.c
@@ -608,7 +608,7 @@
tps_alert_add(tps, -1);
}
} else {
- if (high_water <= tps->tps_queue_size) {
+ if (high_water < tps->tps_queue_size) {
/* Update water mark alert immediately */
tps->high_water_alert = 1;
tps_alert_add(tps, +1);
@@ -883,11 +883,11 @@
AST_LIST_INSERT_TAIL(&tps->tps_queue, t, list);
previous_size = tps->tps_queue_size++;
- if (previous_size >= tps->tps_queue_high) {
+ 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 %d scheduled tasks.\n",
- tps->name, previous_size);
+ 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) {
tps->high_water_alert = 1;
--
To view, visit https://gerrit.asterisk.org/3476
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I687729fb4efa6a0ba38ec9c1c133c4d407bc3d5d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
More information about the asterisk-commits
mailing list