Skip to content

Commit 3fac516

Browse files
committed
Disable multithreaded KEYS due to bugs
1 parent 2f65aa2 commit 3fac516

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/db.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,9 @@ void keysCommand(client *c) {
643643
unsigned long numkeys = 0;
644644
void *replylen = addReplyDeferredLen(c);
645645

646+
#ifdef MULTITHREADED_KEYS
646647
aeReleaseLock();
648+
#endif
647649

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

668+
#ifdef MULTITHREADED_KEYS
666669
fastlock_unlock(&c->db->lock); // we must release the DB lock before acquiring the AE lock to prevent deadlocks
667670
AeLocker lock;
668671
lock.arm(c);
669672
fastlock_lock(&c->db->lock); // we still need the DB lock
670673
lock.release();
674+
#endif
671675
}
672676

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

0 commit comments

Comments
 (0)