diff --git a/src/networking.c b/src/networking.c index 1c2747dc27..784083a4f9 100644 --- a/src/networking.c +++ b/src/networking.c @@ -517,7 +517,7 @@ void afterErrorReply(client *c, const char *s, size_t len, int flags) { /* After the errors RAX reaches this limit, instead of tracking * custom LUA errors, we track the error under `error_LUA` */ if (flags & ERR_REPLY_FLAG_LUA && raxSize(server.errors) >= ERROR_STATS_LUA_LIMIT) { - incrementErrorCount("LUA_ERRORSTATS_DISABLED", 23); + incrementErrorCount(LUA_ERRORSTATS_OVERFLOW_ERR, strlen(LUA_ERRORSTATS_OVERFLOW_ERR)); /* If the string already starts with "-..." then the error prefix * is provided by the caller ( we limit the search to 32 chars). Otherwise we use "-ERR". */ } else if (s[0] != '-') { diff --git a/src/server.h b/src/server.h index 4ff209c0e9..b77ef69dfd 100644 --- a/src/server.h +++ b/src/server.h @@ -2564,7 +2564,8 @@ void serverSetCpuAffinity(const char *cpulist); /* ERROR STATS constants */ #define ERROR_STATS_LUA_LIMIT 128 /* After the errors RAX reaches this limit, instead of tracking - custom LUA errors, we track the error under `error_LUA`. */ + custom LUA errors, we track the error under `error_LUA_ERRORSTATS_OVERFLOW`. */ +#define LUA_ERRORSTATS_OVERFLOW_ERR "LUA_ERRORSTATS_OVERFLOW" /* afterErrorReply flags */ #define ERR_REPLY_FLAG_NO_STATS_UPDATE (1ULL<<0) /* Indicating that we should not update diff --git a/tests/unit/info.tcl b/tests/unit/info.tcl index dbe4d3606d..6a7fbe9438 100644 --- a/tests/unit/info.tcl +++ b/tests/unit/info.tcl @@ -281,9 +281,9 @@ start_server {tags {"info" "external:skip"}} { r eval {return redis.error_reply(string.format('%s my error message', ARGV[1]))} 0 $j } } - # Validate that custom LUA errors are tracked in `LUA_ERRORSTATS_DISABLED` when errors + # Validate that custom LUA errors are tracked in `LUA_ERRORSTATS_OVERFLOW` when errors # has 128 entries. - assert_equal "count=972" [errorstat LUA_ERRORSTATS_DISABLED] + assert_equal "count=972" [errorstat LUA_ERRORSTATS_OVERFLOW] # Validate that non LUA errors continue to be tracked even when we have >=128 entries. assert_error {ERR syntax error} {r set a b c d e f g} assert_equal "count=1" [errorstat ERR]