Please sign in to comment.
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redis cache store: avoid blocking the server in `#delete_matched`
Fixes #32610. Closes #32614. Lua scripts in redis are *blocking*, meaning that no other client can execute any commands while the script is running. See https://redis.io/commands/eval#atomicity-of-scripts. This results in the following exceptions once the number of keys is sufficiently large: BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE. This commit replaces the lua-based implementation with one that uses `SCAN` and `DEL` in batches. This doesn't block the server. The primary limitation of `SCAN`, i.e. potential duplicate keys, is of no consequence here, because `DEL` ignores keys that do not exist.
- Loading branch information
Showing with 18 additions and 6 deletions.