diff options
author | Oran Agra <oran@redislabs.com> | 2022-02-21 11:20:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-21 11:20:41 +0200 |
commit | fad0b0d2a680498fce1cd7e153f8ad7396a79edf (patch) | |
tree | 181fc209c0f8c52dec51375bb80c7a3cd9e8403a /src/server.h | |
parent | b59bb9b476cbcc9ed321dc5172be3ba2e0738142 (diff) | |
download | redis-fad0b0d2a680498fce1cd7e153f8ad7396a79edf.tar.gz |
Fix error stats and failed command stats for blocked clients (#10309)
This is a followup work for #10278, and a discussion about #10279
The changes:
- fix failed_calls in command stats for blocked clients that got error.
including CLIENT UNBLOCK, and module replying an error from a thread.
- fix latency stats for XREADGROUP that filed with -NOGROUP
Theory behind which errors should be counted:
- error stats represents errors returned to the user, so an error handled by a
module should not be counted.
- total error counter should be the same.
- command stats represents execution of commands (even with RM_Call, and if
they fail or get rejected it counts these calls in commandstats, so it should
also count failed_calls)
Some thoughts about Scripts:
for scripts it could be different since they're part of user code, not the infra (not an extension to redis)
we certainly want commandstats to contain all calls and errors
a simple script is like mult-exec transaction so an error inside it should be counted in error stats
a script that replies with an error to the user (using redis.error_reply) should also be counted in error stats
but then the problem is that a plain `return redis.call("SET")` should not be counted twice (once for the SET
and once for EVAL)
so that's something left to be resolved in #10279
Diffstat (limited to 'src/server.h')
-rw-r--r-- | src/server.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/server.h b/src/server.h index 41c1a3feb..bd1fed159 100644 --- a/src/server.h +++ b/src/server.h @@ -3090,7 +3090,7 @@ void disconnectAllBlockedClients(void); void handleClientsBlockedOnKeys(void); void signalKeyAsReady(redisDb *db, robj *key, int type); void blockForKeys(client *c, int btype, robj **keys, int numkeys, long count, mstime_t timeout, robj *target, struct blockPos *blockpos, streamID *ids); -void updateStatsOnUnblock(client *c, long blocked_us, long reply_us); +void updateStatsOnUnblock(client *c, long blocked_us, long reply_us, int had_errors); /* timeout.c -- Blocked clients timeout and connections timeout. */ void addClientToTimeoutTable(client *c); |