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

Introduce fast path to bypass expensive serveClientsBlockedOnKeyByModule call
This commit is contained in:
Igor 2021-03-25 15:16:03 +01:00 committed by GitHub
parent 1976acfe3e
commit cf0a909e2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -480,6 +480,10 @@ void serveClientsBlockedOnStreamKey(robj *o, readyList *rl) {
void serveClientsBlockedOnKeyByModule(readyList *rl) {
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
* this key, from the first blocked to the last. */
de = dictFind(rl->db->blocking_keys,rl->key);