Commit 0fefed25 authored by antirez's avatar antirez
Browse files

Fix patch provided in #6554.

parent e9fbc960
...@@ -262,6 +262,13 @@ void handleClientsBlockedOnKeys(void) { ...@@ -262,6 +262,13 @@ void handleClientsBlockedOnKeys(void) {
* we can safely call signalKeyAsReady() against this key. */ * we can safely call signalKeyAsReady() against this key. */
dictDelete(rl->db->ready_keys,rl->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++; server.call_depth++;
updateCachedTime(0); updateCachedTime(0);
...@@ -461,7 +468,7 @@ void handleClientsBlockedOnKeys(void) { ...@@ -461,7 +468,7 @@ void handleClientsBlockedOnKeys(void) {
} }
} }
server.call_depth++; server.call_depth--;
/* Free this item. */ /* Free this item. */
decrRefCount(rl->key); decrRefCount(rl->key);
......
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