• Binbin's avatar
    Prevent lua error_reply abuse from causing errorstats to become larger (#13141) · e04d41d7
    Binbin authored
    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.
    e04d41d7
server.c 290 KB