summaryrefslogtreecommitdiff
path: root/src/module.c
diff options
context:
space:
mode:
authorMadelyn Olson <34459052+madolson@users.noreply.github.com>2023-03-29 19:58:51 -0700
committerGitHub <noreply@github.com>2023-03-29 19:58:51 -0700
commit971b177fa338fe06cb67a930c6e54467d29ec44f (patch)
tree441962ff76914ce9ea2ff97b2ab763568c8d62ab /src/module.c
parent0c3b8b7e90ea242640a417abb5c40f30dfc3e036 (diff)
downloadredis-971b177fa338fe06cb67a930c6e54467d29ec44f.tar.gz
Fixed tracking of command duration for multi/eval/module/wait (#11970)
In #11012, we changed the way command durations were computed to handle the same command being executed multiple times. This commit fixes some misses from that commit. * Wait commands were not correctly reporting their duration if the timeout was reached. * Multi/scripts/and modules with RM_Call were not properly resetting the duration between inner calls, leading to them reporting cumulative duration. * When a blocked client is freed, the call and duration are always discarded. This commit also adds an assert if the duration is not properly reset, potentially indicating that a report to call statistics was missed. The assert potentially be removed in the future, as it's mainly intended to detect misses in tests.
Diffstat (limited to 'src/module.c')
-rw-r--r--src/module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/module.c b/src/module.c
index a8df08bbb..5f65a2035 100644
--- a/src/module.c
+++ b/src/module.c
@@ -647,6 +647,7 @@ void moduleReleaseTempClient(client *c) {
clearClientConnectionState(c);
listEmpty(c->reply);
c->reply_bytes = 0;
+ c->duration = 0;
resetClient(c);
c->bufpos = 0;
c->flags = CLIENT_MODULE;