summaryrefslogtreecommitdiffstats
path: root/src/server.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-04 17:58:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-04 17:58:41 +0000
commitd7bc17f61954de2a29ab751e53ee1ce90d3a49e1 (patch)
treec9320c4588fc639b2c5aacf878edd67bccebfc57 /src/server.c
parentAdding upstream version 5:7.2.4. (diff)
downloadredis-d7bc17f61954de2a29ab751e53ee1ce90d3a49e1.tar.xz
redis-d7bc17f61954de2a29ab751e53ee1ce90d3a49e1.zip
Adding upstream version 5:7.2.5.upstream/5%7.2.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--src/server.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/server.c b/src/server.c
index 438325f..4d47b5e 100644
--- a/src/server.c
+++ b/src/server.c
@@ -3512,12 +3512,20 @@ void call(client *c, int flags) {
* re-processing and unblock the client.*/
c->flags |= CLIENT_EXECUTING_COMMAND;
+ /* Setting the CLIENT_REPROCESSING_COMMAND flag so that during the actual
+ * processing of the command proc, the client is aware that it is being
+ * re-processed. */
+ if (reprocessing_command) c->flags |= CLIENT_REPROCESSING_COMMAND;
+
monotime monotonic_start = 0;
if (monotonicGetType() == MONOTONIC_CLOCK_HW)
monotonic_start = getMonotonicUs();
c->cmd->proc(c);
+ /* Clear the CLIENT_REPROCESSING_COMMAND flag after the proc is executed. */
+ if (reprocessing_command) c->flags &= ~CLIENT_REPROCESSING_COMMAND;
+
exitExecutionUnit();
/* In case client is blocked after trying to execute the command,
@@ -3575,7 +3583,7 @@ void call(client *c, int flags) {
/* Send the command to clients in MONITOR mode if applicable,
* since some administrative commands are considered too dangerous to be shown.
- * Other exceptions is a client which is unblocked and retring to process the command
+ * Other exceptions is a client which is unblocked and retrying to process the command
* or we are currently in the process of loading AOF. */
if (update_command_stats && !reprocessing_command &&
!(c->cmd->flags & (CMD_SKIP_MONITOR|CMD_ADMIN))) {