Commit ea3f7c6f authored by antirez's avatar antirez
Browse files

TCC: also use synchronous execution on AOF loading.

parent ca3fd367
...@@ -7302,11 +7302,15 @@ void executeThreadedCommand(client *c, coreThreadedCommandCallback callback, voi ...@@ -7302,11 +7302,15 @@ void executeThreadedCommand(client *c, coreThreadedCommandCallback callback, voi
copy->argv[j] = createStringObject(c->argv[j]->ptr, copy->argv[j] = createStringObject(c->argv[j]->ptr,
sdslen(c->argv[j]->ptr)); sdslen(c->argv[j]->ptr));
/* Try to spawn the thread that will actually execute the command. */ /* Try to spawn the thread that will actually execute the command.
* There are many conditions where we perfer to perform a synchronous
* execution of the command. For instance in all the situations we
* can't block such as Lua script, MULTI/EXEC, or when loading the
* AOF file. */
int islua = c->flags & CLIENT_LUA; int islua = c->flags & CLIENT_LUA;
int ismulti = c->flags & CLIENT_MULTI; int ismulti = c->flags & CLIENT_MULTI;
pthread_t tid; pthread_t tid;
if (islua || ismulti || if (islua || ismulti || server.loading ||
CoreModuleBlockedClients >= CoreModuleThreadsMax || CoreModuleBlockedClients >= CoreModuleThreadsMax ||
pthread_create(&tid,NULL,threadedCoreCommandEnty,tcpd) != 0) pthread_create(&tid,NULL,threadedCoreCommandEnty,tcpd) != 0)
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment