summaryrefslogtreecommitdiff
path: root/src/expire.c
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2017-06-23 11:42:25 +0200
committerantirez <antirez@gmail.com>2017-06-23 11:42:25 +0200
commitc9097393bf63172fcae014808f79ddf0d9706204 (patch)
tree2ea0322c2532cc0b0b7c78b7338baf86fd99471e /src/expire.c
parent936ade80b2dc2019bfc2dc20de024ede91d6eacb (diff)
downloadredis-c9097393bf63172fcae014808f79ddf0d9706204.tar.gz
Issue #4027: unify comment and modify return value in freeMemoryIfNeeded().
It looks safer to return C_OK from freeMemoryIfNeeded() when clients are paused because returning C_ERR may prevent success of writes. It is possible that there is no difference in practice since clients cannot execute writes while clients are paused, but it looks more correct this way, at least conceptually. Related to PR #4028.
Diffstat (limited to 'src/expire.c')
-rw-r--r--src/expire.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/expire.c b/src/expire.c
index 14da78ec3..a02fe566a 100644
--- a/src/expire.c
+++ b/src/expire.c
@@ -105,8 +105,9 @@ 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. */
+ /* When clients are paused the dataset should be static not just from the
+ * POV of clients not being able to write, but also from the POV of
+ * expires and evictions of keys not being performed. */
if (clientsArePaused()) return;
if (type == ACTIVE_EXPIRE_CYCLE_FAST) {