Fix patch provided in #6554.

This commit is contained in:
antirez 2019-11-19 11:23:43 +01:00
parent 6a9851c7f8
commit b42466b925

View File

@ -514,6 +514,13 @@ void handleClientsBlockedOnKeys(void) {
* we can safely call signalKeyAsReady() against this key. */
dictDelete(rl->db->ready_keys,rl->key);
/* Even if we are not inside call(), increment the call depth
* in order to make sure that keys are expired against a fixed
* reference time, and not against the wallclock time. This
* way we can lookup an object multiple times (BRPOPLPUSH does
* that) without the risk of it being freed in the second
* lookup, invalidating the first one.
* See https://github.com/antirez/redis/pull/6554. */
server.call_depth++;
updateCachedTime(0);
@ -533,7 +540,7 @@ void handleClientsBlockedOnKeys(void) {
serveClientsBlockedOnKeyByModule(rl);
}
server.call_depth++;
server.call_depth--;
/* Free this item. */
decrRefCount(rl->key);