If a Lua script executes for more time than the max time specified in the configuration Redis will log a warning, and will start accepting queries (re-entering the event loop), returning -SLOWSCRIPT error for all the commands but SHUTDOWN that remains callable.

This commit is contained in:
antirez
2011-10-27 14:49:10 +02:00
parent bb48c5fa67
commit 115e3ff39e
4 changed files with 31 additions and 9 deletions

View File

@ -345,7 +345,7 @@ struct sharedObjectsStruct {
robj *crlf, *ok, *err, *emptybulk, *czero, *cone, *cnegone, *pong, *space,
*colon, *nullbulk, *nullmultibulk, *queued,
*emptymultibulk, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr,
*outofrangeerr, *noscripterr, *loadingerr, *plus,
*outofrangeerr, *noscripterr, *loadingerr, *slowscripterr, *plus,
*select0, *select1, *select2, *select3, *select4,
*select5, *select6, *select7, *select8, *select9,
*messagebulk, *pmessagebulk, *subscribebulk, *unsubscribebulk, *mbulk3,
@ -639,6 +639,8 @@ struct redisServer {
long long lua_time_start;
int lua_random_dirty; /* True if a random command was called during the
exection of the current script. */
int lua_timedout; /* True if we reached the time limit for script
execution. */
};
typedef struct pubsubPattern {