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
e1839ab3
Commit
e1839ab3
authored
Mar 21, 2017
by
Oran Agra
Committed by
antirez
May 13, 2019
Browse files
diskless fork kept streaming RDB to a disconnected slave
parent
3b207b89
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/networking.c
View file @
e1839ab3
...
@@ -809,6 +809,16 @@ void unlinkClient(client *c) {
...
@@ -809,6 +809,16 @@ void unlinkClient(client *c) {
c
->
client_list_node
=
NULL
;
c
->
client_list_node
=
NULL
;
}
}
/* In the case of diskless replication the fork is writing to the
* sockets and just closing the fd isn't enough, if we don't also
* shutdown the socket the fork will continue to write to the slave
* and the salve will only find out that it was disconnected when
* it will finish reading the rdb. */
if
((
c
->
flags
&
CLIENT_SLAVE
)
&&
(
c
->
replstate
==
SLAVE_STATE_WAIT_BGSAVE_END
))
{
shutdown
(
c
->
fd
,
SHUT_RDWR
);
}
/* Unregister async I/O handlers and close the socket. */
/* Unregister async I/O handlers and close the socket. */
aeDeleteFileEvent
(
server
.
el
,
c
->
fd
,
AE_READABLE
);
aeDeleteFileEvent
(
server
.
el
,
c
->
fd
,
AE_READABLE
);
aeDeleteFileEvent
(
server
.
el
,
c
->
fd
,
AE_WRITABLE
);
aeDeleteFileEvent
(
server
.
el
,
c
->
fd
,
AE_WRITABLE
);
...
...
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