3 ms·
Those kind of dos (while true do end), actually we handle quite well already, because we don't use LuaJIT but plain Lua that has hooks that allow Redis to detec
by antirez 8y ago
Those kind of dos (while true do end), actually we handle quite well already, because we don't use LuaJIT but plain Lua that has hooks that allow Redis to detect such conditions. But in general, it's a "can of worms" indeed.
- andrewmcwatters 8y agoiirc and ime, that sort of provision in Lua only allows you keep running at a cost. You'll still encounter hitching because infinite loop detection is based on a detection of number of line executions.
- antirez 8y agoYes, but in the case of Redis the fact that an user makes its own Redis server slower is not an issue basically. It is enough that we can detect this and kill the script.
- cjcole 8y agoAre your Lua changes public? I couldn't find a relevant repo. Thanks.
- aarongolliver 8y agoIf you have the time he has a great video here[0] that talks about redis+LUA [0] https://www.youtube.com/watch?v=RaIwBagADVM https://www.youtube.com/watch?v=RaIwBagADVM
- antirez 8y agoYes but there is no direct modification to the Lua code, we just install the hooks from the Redis source code using the Lua interpreter. So the implementation of that is directly inside the Redis source tree, scripting.c file.