Avoid defragging scripts during EVAL command execution (#1414)
This can happen when scripts are running for long period of time and the server attempts to defrag it in the whileBlockedCron. Signed-off-by: Ran Shidlansik <ranshid@amazon.com>
This commit is contained in:
parent
5f7fe9ef21
commit
2d92404522
@ -34,6 +34,7 @@
|
||||
*/
|
||||
|
||||
#include "server.h"
|
||||
#include "script.h"
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef HAVE_DEFRAG
|
||||
@ -1050,6 +1051,9 @@ static doneStatus defragLuaScripts(monotime endtime, void *target, void *privdat
|
||||
UNUSED(target);
|
||||
UNUSED(privdata);
|
||||
if (endtime == 0) return DEFRAG_NOT_DONE; // required initialization
|
||||
/* In case we are in the process of eval some script we do not want to replace the script being run
|
||||
* so we just bail out without really defragging here. */
|
||||
if (scriptIsRunning()) return DEFRAG_DONE;
|
||||
activeDefragSdsDict(evalScriptsDict(), DEFRAG_SDS_DICT_VAL_LUA_SCRIPT);
|
||||
return DEFRAG_DONE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user