mirror of
https://github.com/fluencelabs/redis
synced 2025-03-30 22:31:03 +00:00
Net: processUnblockedClients() and clientsArePaused() minor changes.
1. No need to set btype in processUnblockedClients(), since clients flagged REDIS_UNBLOCKED should have it already cleared. 2. When putting clients in the unblocked clients list, clientsArePaused() should flag them with REDIS_UNBLOCKED. Not strictly needed with the current code but is more coherent.
This commit is contained in:
parent
5fe4a23131
commit
2b278a3394
@ -114,7 +114,6 @@ void processUnblockedClients(void) {
|
|||||||
c = ln->value;
|
c = ln->value;
|
||||||
listDelNode(server.unblocked_clients,ln);
|
listDelNode(server.unblocked_clients,ln);
|
||||||
c->flags &= ~REDIS_UNBLOCKED;
|
c->flags &= ~REDIS_UNBLOCKED;
|
||||||
c->btype = REDIS_BLOCKED_NONE;
|
|
||||||
|
|
||||||
/* Process remaining data in the input buffer. */
|
/* Process remaining data in the input buffer. */
|
||||||
if (c->querybuf && sdslen(c->querybuf) > 0) {
|
if (c->querybuf && sdslen(c->querybuf) > 0) {
|
||||||
|
@ -1676,7 +1676,9 @@ void pauseClients(mstime_t end) {
|
|||||||
/* Return non-zero if clients are currently paused. As a side effect the
|
/* Return non-zero if clients are currently paused. As a side effect the
|
||||||
* function checks if the pause time was reached and clear it. */
|
* function checks if the pause time was reached and clear it. */
|
||||||
int clientsArePaused(void) {
|
int clientsArePaused(void) {
|
||||||
if (server.clients_paused && server.clients_pause_end_time < server.mstime) {
|
if (server.clients_paused &&
|
||||||
|
server.clients_pause_end_time < server.mstime)
|
||||||
|
{
|
||||||
listNode *ln;
|
listNode *ln;
|
||||||
listIter li;
|
listIter li;
|
||||||
redisClient *c;
|
redisClient *c;
|
||||||
@ -1689,7 +1691,10 @@ int clientsArePaused(void) {
|
|||||||
while ((ln = listNext(&li)) != NULL) {
|
while ((ln = listNext(&li)) != NULL) {
|
||||||
c = listNodeValue(ln);
|
c = listNodeValue(ln);
|
||||||
|
|
||||||
|
/* Don't touch slaves and blocked clients. The latter pending
|
||||||
|
* requests be processed when unblocked. */
|
||||||
if (c->flags & (REDIS_SLAVE|REDIS_BLOCKED)) continue;
|
if (c->flags & (REDIS_SLAVE|REDIS_BLOCKED)) continue;
|
||||||
|
c->flags |= REDIS_UNBLOCKED;
|
||||||
listAddNodeTail(server.unblocked_clients,c);
|
listAddNodeTail(server.unblocked_clients,c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user