diff options
author | Jim Brunner <brunnerj@amazon.com> | 2020-08-10 22:36:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-10 22:36:34 -0700 |
commit | f39c9404a397d7c48a6e8347666f9d037861db60 (patch) | |
tree | a9657a3856d98d0f618e65917a1bd626243f5a60 | |
parent | 229327ad8be5cd87ead56884228dfb08b6017c45 (diff) | |
download | redis-f39c9404a397d7c48a6e8347666f9d037861db60.tar.gz |
Prevent dictRehashMilliseconds from rehashing while a safe iterator is present (#5948)
-rw-r--r-- | src/dict.c | 2 |
1 files changed, 2 insertions, 0 deletions
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; |