diff options
author | antirez <antirez@gmail.com> | 2018-10-09 13:18:25 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2018-10-09 13:18:52 +0200 |
commit | 929c686ccee0aacc567a9892931ae46c82a2e8cd (patch) | |
tree | 8557900507551dad6242308f64c2e3e73eec8ef2 /src/scripting.c | |
parent | 69c30965eb15ed86acadd8e9db79feb7b7633497 (diff) | |
download | redis-929c686ccee0aacc567a9892931ae46c82a2e8cd.tar.gz |
Actually use the protectClient() API where needed.
Related to #4804.
Diffstat (limited to 'src/scripting.c')
-rw-r--r-- | src/scripting.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/scripting.c b/src/scripting.c index 979156037..260b3679c 100644 --- a/src/scripting.c +++ b/src/scripting.c @@ -1242,7 +1242,7 @@ void luaMaskCountHook(lua_State *lua, lua_Debug *ar) { * we need to mask the client executing the script from the event loop. * If we don't do that the client may disconnect and could no longer be * here when the EVAL command will return. */ - aeDeleteFileEvent(server.el, server.lua_caller->fd, AE_READABLE); + protectClient(server.lua_caller); } if (server.lua_timedout) processEventsWhileBlocked(); if (server.lua_kill) { @@ -1370,10 +1370,9 @@ void evalGenericCommand(client *c, int evalsha) { if (delhook) lua_sethook(lua,NULL,0,0); /* Disable hook */ if (server.lua_timedout) { server.lua_timedout = 0; - /* Restore the readable handler that was unregistered when the - * script timeout was detected. */ - aeCreateFileEvent(server.el,c->fd,AE_READABLE, - readQueryFromClient,c); + /* Restore the client that was protected when the script timeout + * was detected. */ + unprotectClient(c); if (server.masterhost && server.master) queueClientForReprocessing(server.master); } |