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
15338ab6
Unverified
Commit
15338ab6
authored
Mar 16, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 16, 2020
Browse files
Merge pull request #6991 from soloestoy/io-threads-bugfix
Threaded IO: bugfix client kill may crash redis
parents
f1e4af2c
a6a0e05a
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
15338ab6
...
...
@@ -3040,16 +3040,22 @@ int handleClientsWithPendingReadsUsingThreads(void) {
if
(
tio_debug
)
printf
(
"I/O READ All threads finshed
\n
"
);
/* Run the list of clients again to process the new buffers. */
listRewind
(
server
.
clients_pending_read
,
&
li
);
while
((
ln
=
list
Next
(
&
li
)))
{
while
(
listLength
(
server
.
clients_pending_read
))
{
ln
=
list
First
(
server
.
clients_pending_read
);
client
*
c
=
listNodeValue
(
ln
);
c
->
flags
&=
~
CLIENT_PENDING_READ
;
listDelNode
(
server
.
clients_pending_read
,
ln
);
if
(
c
->
flags
&
CLIENT_PENDING_COMMAND
)
{
c
->
flags
&=
~
CLIENT_PENDING_COMMAND
;
processCommandAndResetClient
(
c
);
c
->
flags
&=
~
CLIENT_PENDING_COMMAND
;
if
(
processCommandAndResetClient
(
c
)
==
C_ERR
)
{
/* If the client is no longer valid, we avoid
* processing the client later. So we just go
* to the next. */
continue
;
}
}
processInputBufferAndReplicate
(
c
);
}
listEmpty
(
server
.
clients_pending_read
);
return
processed
;
}
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