Prevent lua error_reply abuse from causing errorstats to become larger#13141
Merged
oranagra merged 3 commits intoredis:unstablefrom Mar 19, 2024
Merged
Prevent lua error_reply abuse from causing errorstats to become larger#13141oranagra merged 3 commits intoredis:unstablefrom
oranagra merged 3 commits intoredis:unstablefrom
Conversation
Users who abuse lua error_reply will generate a new error object on each error call, which can make server.errors get bigger and bigger. This will cause the server to block when calling INFO (we also return errorstats by default). To prevent the damage it can cause, when a misuse is detected, we will print a warning log and disable the errorstats to avoid adding more new errors. It can be re-enabled via CONFIG RESETSTAT. Because server.errors may be very large (it may be better now since we have the limit), config resetstat may block for a while. So in resetErrorTableStats, we will try to lazyfree server.errors. See the related discussion at the end of redis#8217.
oranagra
reviewed
Mar 17, 2024
oranagra
reviewed
Mar 18, 2024
oranagra
approved these changes
Mar 19, 2024
Contributor
Author
|
i guess we should mark it as release notes? or need to explain this new error code |
Member
|
since this is only triggered by a misuse that i imagine is very rare, i figured that we don't need to mention it, but i suppose it won't harm either. |
funny-dog
pushed a commit
to funny-dog/redis
that referenced
this pull request
Sep 17, 2025
redis#13141) Users who abuse lua error_reply will generate a new error object on each error call, which can make server.errors get bigger and bigger. This will cause the server to block when calling INFO (we also return errorstats by default). To prevent the damage it can cause, when a misuse is detected, we will print a warning log and disable the errorstats to avoid adding more new errors. It can be re-enabled via CONFIG RESETSTAT. Because server.errors may be very large (it may be better now since we have the limit), config resetstat may block for a while. So in resetErrorTableStats, we will try to lazyfree server.errors. See the related discussion at the end of redis#8217.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Users who abuse lua error_reply will generate a new error object on each
error call, which can make server.errors get bigger and bigger. This will
cause the server to block when calling INFO (we also return errorstats by
default).
To prevent the damage it can cause, when a misuse is detected, we will
print a warning log and disable the errorstats to avoid adding more new
errors. It can be re-enabled via CONFIG RESETSTAT.
Because server.errors may be very large (it may be better now since we
have the limit), config resetstat may block for a while. So in
resetErrorTableStats, we will try to lazyfree server.errors.
See the related discussion at the end of #8217.
log output:
after disabled, info errorstats output: