fix(sentinel): sentinel.running_scripts will always increase more times and not reset

when trigger a always fail scripts, sentinel.running_scripts will increase ten times, however it
only decrease one times onretry the maximum. and it will't reset, when it become
SENTINEL_SCRIPT_MAX_RUNNING, sentinel don't trigger scripts.
This commit is contained in:
omg-by 2020-04-18 00:49:16 +08:00
parent 6d2f1188ac
commit 9d27e00ddb

View File

@ -859,6 +859,7 @@ void sentinelCollectTerminatedScripts(void) {
sj->pid = 0; sj->pid = 0;
sj->start_time = mstime() + sj->start_time = mstime() +
sentinelScriptRetryDelay(sj->retry_num); sentinelScriptRetryDelay(sj->retry_num);
sentinel.running_scripts--;
} else { } else {
/* Otherwise let's remove the script, but log the event if the /* Otherwise let's remove the script, but log the event if the
* execution did not terminated in the best of the ways. */ * execution did not terminated in the best of the ways. */