From 88e97fe2bdb6195b64c99671d73ccef1195870a6 Mon Sep 17 00:00:00 2001 From: Jim Brunner Date: Mon, 10 Aug 2020 22:36:34 -0700 Subject: [PATCH] Prevent dictRehashMilliseconds from rehashing while a safe iterator is present (#5948) --- src/dict.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dict.c b/src/dict.c index 45aab66f9..a26ef18d3 100644 --- a/src/dict.c +++ b/src/dict.c @@ -239,6 +239,8 @@ long long timeInMilliseconds(void) { /* Rehash for an amount of time between ms milliseconds and ms+1 milliseconds */ int dictRehashMilliseconds(dict *d, int ms) { + if (d->iterators > 0) return 0; + long long start = timeInMilliseconds(); int rehashes = 0;