Skip to content

An infinite Lua script pins a thread and cannot be interrupted (no SCRIPT KILL, no lua-time-limit) #8269

Description

@vyavdoshenko

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 server

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions