Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ea3f7c6f
Commit
ea3f7c6f
authored
Jun 04, 2020
by
antirez
Browse files
TCC: also use synchronous execution on AOF loading.
parent
ca3fd367
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/module.c
View file @
ea3f7c6f
...
@@ -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
)
{
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment