Skip to content

Commit

Permalink
Disable multithreaded KEYS due to bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Oct 21, 2019
1 parent 2f65aa2 commit 3fac516
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,9 @@ void keysCommand(client *c) {
unsigned long numkeys = 0;
void *replylen = addReplyDeferredLen(c);

#ifdef MULTITHREADED_KEYS
aeReleaseLock();
#endif

di = dictGetSafeIterator(c->db->pdict);
allkeys = (pattern[0] == '*' && pattern[1] == '\0');
Expand All @@ -663,11 +665,13 @@ void keysCommand(client *c) {
dictReleaseIterator(di);
setDeferredArrayLen(c,replylen,numkeys);

#ifdef MULTITHREADED_KEYS
fastlock_unlock(&c->db->lock); // we must release the DB lock before acquiring the AE lock to prevent deadlocks
AeLocker lock;
lock.arm(c);
fastlock_lock(&c->db->lock); // we still need the DB lock
lock.release();
#endif
}

/* This callback is used by scanGenericCommand in order to collect elements
Expand Down

0 comments on commit 3fac516

Please sign in to comment.