Commit 5c6f0b26 authored by Igor's avatar Igor Committed by Oran Agra
Browse files

Introduce fast path to bypass expensive serveClientsBlockedOnKeyByModule call (#8689)

Introduce fast path to bypass expensive serveClientsBlockedOnKeyByModule call

(cherry picked from commit cf0a909e)
parent 8bcca06c
...@@ -425,6 +425,10 @@ void serveClientsBlockedOnStreamKey(robj *o, readyList *rl) { ...@@ -425,6 +425,10 @@ void serveClientsBlockedOnStreamKey(robj *o, readyList *rl) {
void serveClientsBlockedOnKeyByModule(readyList *rl) { void serveClientsBlockedOnKeyByModule(readyList *rl) {
dictEntry *de; dictEntry *de;
/* Optimization: If no clients are in type BLOCKED_MODULE,
* we can skip this loop. */
if (!server.blocked_clients_by_type[BLOCKED_MODULE]) return;
/* We serve clients in the same order they blocked for /* We serve clients in the same order they blocked for
* this key, from the first blocked to the last. */ * this key, from the first blocked to the last. */
de = dictFind(rl->db->blocking_keys,rl->key); de = dictFind(rl->db->blocking_keys,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