serverLog(LL_WARNING,"Lua slow script detected: still in execution after %lld milliseconds. You can try killing the script using the SCRIPT KILL command.",elapsed);
serverLog(LL_WARNING,
"Lua slow script detected: still in execution after %lld milliseconds. "
"You can try killing the script using the SCRIPT KILL command. "
"Script SHA1 is: %s",
elapsed,server.lua_cur_script);
server.lua_timedout=1;
server.lua_timedout=1;
/* Once the script timeouts we reenter the event loop to permit others
/* Once the script timeouts we reenter the event loop to permit others
* to call SCRIPT KILL or SHUTDOWN NOSAVE if needed. For this reason
* to call SCRIPT KILL or SHUTDOWN NOSAVE if needed. For this reason
...
@@ -1524,6 +1529,7 @@ void evalGenericCommand(client *c, int evalsha) {
...
@@ -1524,6 +1529,7 @@ void evalGenericCommand(client *c, int evalsha) {
* If we are debugging, we set instead a "line" hook so that the
* If we are debugging, we set instead a "line" hook so that the
* debugger is call-back at every line executed by the script. */
* debugger is call-back at every line executed by the script. */
server.lua_caller=c;
server.lua_caller=c;
server.lua_cur_script=funcname+2;
server.lua_time_start=mstime();
server.lua_time_start=mstime();
server.lua_kill=0;
server.lua_kill=0;
if(server.lua_time_limit>0&&ldb.active==0){
if(server.lua_time_limit>0&&ldb.active==0){
...
@@ -1550,6 +1556,7 @@ void evalGenericCommand(client *c, int evalsha) {
...
@@ -1550,6 +1556,7 @@ void evalGenericCommand(client *c, int evalsha) {
queueClientForReprocessing(server.master);
queueClientForReprocessing(server.master);
}
}
server.lua_caller=NULL;
server.lua_caller=NULL;
server.lua_cur_script=NULL;
/* Call the Lua garbage collector from time to time to avoid a
/* Call the Lua garbage collector from time to time to avoid a
* full cycle performed by Lua, which adds too latency.
* full cycle performed by Lua, which adds too latency.