diff options
author | Zachary Marquez <zachary.marquez@mediafire.com> | 2017-06-01 16:24:10 -0500 |
---|---|---|
committer | Zachary Marquez <zachary.marquez@mediafire.com> | 2017-06-01 16:28:40 -0500 |
commit | a3e53cf9bcf05671e3ac4a170bb6791dbff62eec (patch) | |
tree | 4ef05fc881aaa50a6a35a853e275a25aaed4842c /src/expire.c | |
parent | e91b81c612cc8b0cbb4e7f9bc895e5f23d497027 (diff) | |
download | redis-a3e53cf9bcf05671e3ac4a170bb6791dbff62eec.tar.gz |
Prevent expirations and evictions while paused
Proposed fix to https://github.com/antirez/redis/issues/4027
Diffstat (limited to 'src/expire.c')
-rw-r--r-- | src/expire.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/expire.c b/src/expire.c index 22b1f1da9..0e258ecbb 100644 --- a/src/expire.c +++ b/src/expire.c @@ -105,6 +105,10 @@ void activeExpireCycle(int type) { int dbs_per_call = CRON_DBS_PER_CALL; long long start = ustime(), timelimit; + /* We cannot expire keys while clients are paused as the dataset is + * supposed to be static. */ + if (clientsArePaused()) return; + if (type == ACTIVE_EXPIRE_CYCLE_FAST) { /* Don't start a fast cycle if the previous cycle did not exited * for time limt. Also don't repeat a fast cycle for the same period |