Disable multithreaded KEYS due to bugs

Former-commit-id: 3fac516950e831129da856f32fa373a56a6268a1
This commit is contained in:
John Sully 2019-10-21 12:21:46 -04:00
parent 5eded25f33
commit 6de2f0779a

View File

@ -643,7 +643,9 @@ void keysCommand(client *c) {
unsigned long numkeys = 0; unsigned long numkeys = 0;
void *replylen = addReplyDeferredLen(c); void *replylen = addReplyDeferredLen(c);
#ifdef MULTITHREADED_KEYS
aeReleaseLock(); aeReleaseLock();
#endif
di = dictGetSafeIterator(c->db->pdict); di = dictGetSafeIterator(c->db->pdict);
allkeys = (pattern[0] == '*' && pattern[1] == '\0'); allkeys = (pattern[0] == '*' && pattern[1] == '\0');
@ -663,11 +665,13 @@ void keysCommand(client *c) {
dictReleaseIterator(di); dictReleaseIterator(di);
setDeferredArrayLen(c,replylen,numkeys); 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 fastlock_unlock(&c->db->lock); // we must release the DB lock before acquiring the AE lock to prevent deadlocks
AeLocker lock; AeLocker lock;
lock.arm(c); lock.arm(c);
fastlock_lock(&c->db->lock); // we still need the DB lock fastlock_lock(&c->db->lock); // we still need the DB lock
lock.release(); lock.release();
#endif
} }
/* This callback is used by scanGenericCommand in order to collect elements /* This callback is used by scanGenericCommand in order to collect elements