redis
scripting_error
ai_generated
true
BUSY Redis is busy running a script. You can only call SCRIPT KILL or SHUTDOWN NOSAVE.
ID: redis/busy-script-running
85%Fix Rate
88%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 7 | active | — | — | — |
Root Cause
A Lua script or Redis function is running longer than lua-time-limit (default 5s), blocking all other commands.
genericWorkarounds
-
92% success Use SCRIPT KILL to terminate the running script
redis-cli SCRIPT KILL # only works if the script has NOT performed any writes yet
Sources: https://redis.io/docs/latest/operate/oss_and_stack/management/
-
75% success If script has written data, use SHUTDOWN NOSAVE only as last resort
SCRIPT KILL fails after writes; SHUTDOWN NOSAVE + restart loses unsaved changes. Consider the tradeoff.
-
88% success Fix the Lua script to avoid long execution
Break large operations into batches; use SCAN instead of KEYS; avoid O(n) operations on large sets
Dead Ends
Common approaches that don't work:
-
Use SHUTDOWN NOSAVE to stop the script
90% fail
SHUTDOWN terminates the entire Redis server; all connected clients lose their connection and unsaved data is lost
-
Increase lua-time-limit to avoid the BUSY error
72% fail
Longer limit means longer blocking periods; all other clients are frozen while Lua executes