#8268·dragonfly

SIGABRT when a script result table has an __index metamethod that calls redis.call

Author: vyavdoshenkoCreated Sep 9, 2026Updated Sep 9, 2026
Labelsbug

Found while running the Valkey TCL suite (unit/scripting, "Return table with a metatable that calls the server") against Dragonfly. If a script returns a table whose metatable __index calls redis.call, the metamethod fires while the result is being serialized, which is after the script transaction has already been unlocked. The nested command is then scheduled on a transaction that is no longer runnable and the server aborts (transaction.cc: "Check failed: !IsAtomicMulti() || cid_->IsMultiTransactional()"). Any client with EVAL access can crash the server. In a release build the DCHECK is gone and the nested write would run outside the script's atomic scope.

Reproduce:

redis-cli eval "local a={}; setmetatable(a,{__index=function() redis.call('set','x','1') end}) return a" 1 x
# Error: Server closed the connection
redis-cli ping
# Could not connect: connection refused