Commit 23800d9e authored by antirez's avatar antirez
Browse files

Sentinel: increment pending_commands counter in two more places.

AUTH and SCRIPT KILL were sent without incrementing the pending commands
counter. Clearly this needs some kind of wrapper doing it for the caller
in order to be less bug prone.
parent 671c1dfb
...@@ -1298,9 +1298,10 @@ void sentinelSendAuthIfNeeded(sentinelRedisInstance *ri, redisAsyncContext *c) { ...@@ -1298,9 +1298,10 @@ void sentinelSendAuthIfNeeded(sentinelRedisInstance *ri, redisAsyncContext *c) {
char *auth_pass = (ri->flags & SRI_MASTER) ? ri->auth_pass : char *auth_pass = (ri->flags & SRI_MASTER) ? ri->auth_pass :
ri->master->auth_pass; ri->master->auth_pass;
if (auth_pass) if (auth_pass) {
redisAsyncCommand(c, sentinelDiscardReplyCallback, NULL, "AUTH %s", if (redisAsyncCommand(c, sentinelDiscardReplyCallback, NULL, "AUTH %s",
auth_pass); auth_pass) == REDIS_OK) ri->pending_commands++;
}
} }
/* Create the async connections for the specified instance if the instance /* Create the async connections for the specified instance if the instance
...@@ -1689,8 +1690,10 @@ void sentinelPingReplyCallback(redisAsyncContext *c, void *reply, void *privdata ...@@ -1689,8 +1690,10 @@ void sentinelPingReplyCallback(redisAsyncContext *c, void *reply, void *privdata
(ri->flags & SRI_S_DOWN) && (ri->flags & SRI_S_DOWN) &&
!(ri->flags & SRI_SCRIPT_KILL_SENT)) !(ri->flags & SRI_SCRIPT_KILL_SENT))
{ {
redisAsyncCommand(ri->cc, if (redisAsyncCommand(ri->cc,
sentinelDiscardReplyCallback, NULL, "SCRIPT KILL"); sentinelDiscardReplyCallback, NULL,
"SCRIPT KILL") == REDIS_OK)
ri->pending_commands++;
ri->flags |= SRI_SCRIPT_KILL_SENT; ri->flags |= SRI_SCRIPT_KILL_SENT;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment