An infinite Lua script pins a thread and cannot be interrupted (no SCRIPT KILL, no lua-time-limit)
Author: vyavdoshenkoCreated Sep 9, 2026Updated Sep 9, 2026
Labelsbug
Found while running the Valkey TCL suite (unit/scripting, "Timedout read-only scripts can be killed by SCRIPT KILL" and siblings) against Dragonfly. A Lua script runs to completion on its connection's thread and cannot be preempted: there is no instruction-count hook, no SCRIPT KILL, no lua-time-limit, no busy-reply-threshold, and no BUSY reply. Every client scheduled on that thread hangs; if the script landed on the listener thread, new connections hang too and the server is effectively down. Recovery is only kill -9. Any unprivileged client with EVAL access can hang the server indefinitely with one short command.
Reproduce:
redis-cli eval "while true do end" 0 & # never returns, pins a thread
redis-cli script kill
# ERR Unknown subcommand or wrong number of arguments for 'KILL'
redis-cli config set lua-time-limit 10
# ERR Unknown option or number of arguments for CONFIG SET - 'lua-time-limit'
redis-cli config set busy-reply-threshold 10
# ERR Unknown option or number of arguments for CONFIG SET - 'busy-reply-threshold'
# only kill -9 recovers the serverSource: dragonflydb/dragonfly