mirror of
https://github.com/fluencelabs/redis
synced 2025-05-02 05:52:13 +00:00
modified the BRPOPLPUSH target field cleanup strategy to fix it the proper way.
This commit is contained in:
parent
d7061f8137
commit
b190b0c98f
@ -865,6 +865,9 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
|
|||||||
receiver = ln->value;
|
receiver = ln->value;
|
||||||
dstkey = receiver->bpop.target;
|
dstkey = receiver->bpop.target;
|
||||||
|
|
||||||
|
/* Protect receiver->bpop.target, that will be freed by
|
||||||
|
* the next unblockClientWaitingData() call. */
|
||||||
|
if (dstkey) incrRefCount(dstkey);
|
||||||
/* This should remove the first element of the "clients" list. */
|
/* This should remove the first element of the "clients" list. */
|
||||||
unblockClientWaitingData(receiver);
|
unblockClientWaitingData(receiver);
|
||||||
|
|
||||||
@ -877,13 +880,12 @@ int handleClientsWaitingListPush(redisClient *c, robj *key, robj *ele) {
|
|||||||
} else {
|
} else {
|
||||||
/* BRPOPLPUSH, note that receiver->db is always equal to c->db. */
|
/* BRPOPLPUSH, note that receiver->db is always equal to c->db. */
|
||||||
dstobj = lookupKeyWrite(receiver->db,dstkey);
|
dstobj = lookupKeyWrite(receiver->db,dstkey);
|
||||||
if (dstobj && checkType(receiver,dstobj,REDIS_LIST)) {
|
if (!(dstobj && checkType(receiver,dstobj,REDIS_LIST))) {
|
||||||
decrRefCount(dstkey);
|
|
||||||
} else {
|
|
||||||
rpoplpushHandlePush(c,receiver,dstkey,dstobj,ele);
|
rpoplpushHandlePush(c,receiver,dstkey,dstobj,ele);
|
||||||
decrRefCount(dstkey);
|
decrRefCount(dstkey);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
decrRefCount(dstkey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user