summaryrefslogtreecommitdiff
path: root/src/server.h
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2019-11-06 09:57:29 +0100
committerantirez <antirez@gmail.com>2019-11-06 09:57:29 +0100
commit8b2c0f90442c0646d7265ef150dd5afa3172b86e (patch)
tree5304b483458e660cc7656d63970cfc85e46ec8d2 /src/server.h
parent824f5f0b7a1f32a6e6abf3d355d523d2c6e7bf09 (diff)
downloadredis-8b2c0f90442c0646d7265ef150dd5afa3172b86e.tar.gz
Update PR #6537: use a fresh time outside call().fix-expires-6537
One problem with the solution proposed so far in #6537 is that key lookups outside a command execution via call(), still used a cached time. The cached time needed to be refreshed in multiple places, especially because of modules callbacks from timers, cluster bus, and thread safe contexts, that may use RM_Open(). In order to avoid this problem, this commit introduces the ability to detect if we are inside call(): this way we can use the reference fixed time only when we are in the context of a command execution or Lua script, but for the asynchronous lookups, we can still use mstime() to get a fresh time reference.
Diffstat (limited to 'src/server.h')
-rw-r--r--src/server.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server.h b/src/server.h
index 24dbc079c..4a497c47c 100644
--- a/src/server.h
+++ b/src/server.h
@@ -1134,7 +1134,8 @@ struct redisServer {
list *clients_pending_write; /* There is to write or install handler. */
list *clients_pending_read; /* Client has pending read socket buffers. */
list *slaves, *monitors; /* List of slaves and MONITORs */
- client *current_client; /* Current client, only used on crash report */
+ client *current_client; /* Current client executing the command. */
+ long call_depth; /* call() re-entering count. */
rax *clients_index; /* Active clients dictionary by client ID. */
int clients_paused; /* True if clients are currently paused */
mstime_t clients_pause_end_time; /* Time when we undo clients_paused */