diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2018-04-17 21:17:25 +0100 |
---|---|---|
committer | Jeremy Daer <jeremydaer@gmail.com> | 2018-04-18 19:15:00 -0400 |
commit | ef2af628a9ec1cc4e7b6997a021dd3f85cfe4665 (patch) | |
tree | 016c1fa7bbcf02cd6259659fcbad69e09e8f3230 /activerecord/test/cases/validations/length_validation_test.rb | |
parent | 185fce159721b331cc9a0ae17b662373ee0fc95f (diff) | |
download | rails-ef2af628a9ec1cc4e7b6997a021dd3f85cfe4665.tar.gz rails-ef2af628a9ec1cc4e7b6997a021dd3f85cfe4665.tar.bz2 rails-ef2af628a9ec1cc4e7b6997a021dd3f85cfe4665.zip |
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.
Diffstat (limited to 'activerecord/test/cases/validations/length_validation_test.rb')
0 files changed, 0 insertions, 0 deletions