SCRIPT-KILL(3valkey)
π SCRIPT-KILL
okay so bestie, welcome to the SCRIPT KILL page from the Valkey Command Manual (that's valkey manual, section 3, iykyk) π
β¨ NAME β¨
script-kill β Terminates a server-side Lua script during execution. π
β¨ SYNOPSIS β¨
SCRIPT KILL
β¨ DESCRIPTION β¨
So basically this one kills the valkey-eval(7) EVAL script that's currently executing β but only if the script hasn't done a write operation yet. No writes, no problem. π«Ά
Where this really eats: it's mainly useful for killing a script that's been running for wayyyyy too long (for instance, because it entered an infinite loop because of a bug π). The script gets killed, and the client that's currently blocked inside EVAL will see the command return with an error. Not the fun kind of notification, but a notification.
π¨ Okay now the important part, pay attention bestie. If the script has already performed write operations, it cannot be killed this way, because that would violate Lua's script atomicity contract. Periodt. In that case, the only thing that can kill the script isvalkey-shutdown(7)SHUTDOWN NOSAVEβ which kills the Valkey process in a hard way and prevents it from persisting with half-written information. Yes, that's as dramatic as it sounds. π
Wanna know more about EVAL scripts? Go read valkey-eval-intro(7) Introduction to Eval Scripts. It's giving required reading. π
β¨ REPLY β¨
valkey-protocol(7) Simple string reply: OK. π¦
β¨ COMPLEXITY β¨
Literally constant time, she's efficient like that. β
β¨ ACL CATEGORIES β¨
@scripting@slow
β¨ HISTORY β¨
- Available since: 2.6.0 π°οΈ
β¨ SEE ALSO β¨
eval(3valkey)evalsha(3valkey)evalsha_ro(3valkey)eval_ro(3valkey)fcall(3valkey)fcall_ro(3valkey)function(3valkey)function-delete(3valkey)function-dump(3valkey)function-flush(3valkey)function-help(3valkey)function-kill(3valkey)function-list(3valkey)function-load(3valkey)function-restore(3valkey)function-stats(3valkey)script(3valkey)script-debug(3valkey)script-exists(3valkey)script-flush(3valkey)script-help(3valkey)script-load(3valkey)script-show(3valkey)
k bye ily, go forth and terminate your runaway scripts responsibly πβ¨
this page came to you from version 9.0.0, dated 2025-10-21 β slay ππ
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms