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
75ef4105
Commit
75ef4105
authored
Jul 04, 2014
by
antirez
Browse files
Use a timeout when reading parent ack from AOF child.
parent
2fa9fb64
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/aof.c
View file @
75ef4105
...
@@ -1040,9 +1040,15 @@ int rewriteAppendOnlyFile(char *filename) {
...
@@ -1040,9 +1040,15 @@ int rewriteAppendOnlyFile(char *filename) {
}
}
/* Ask the master to stop sending diffs. */
/* Ask the master to stop sending diffs. */
write
(
server
.
aof_pipe_write_ack_to_parent
,
"!"
,
1
);
if
(
write
(
server
.
aof_pipe_write_ack_to_parent
,
"!"
,
1
)
!=
1
)
goto
werr
;
if
(
read
(
server
.
aof_pipe_read_ack_from_parent
,
&
byte
,
1
)
!=
1
||
if
(
anetNonBlock
(
NULL
,
server
.
aof_pipe_read_ack_from_parent
)
!=
ANET_OK
)
goto
werr
;
/* We read the ACK from the server using a 10 seconds timeout. Normally
* it should reply ASAP, but just in case we lose its reply, we are sure
* the child will eventually get terminated. */
if
(
syncRead
(
server
.
aof_pipe_read_ack_from_parent
,
&
byte
,
1
,
5000
)
!=
1
||
byte
!=
'!'
)
goto
werr
;
byte
!=
'!'
)
goto
werr
;
redisLog
(
REDIS_NOTICE
,
"Parent agreed to stop sending diffs. Finalizing AOF..."
);
/* Read the final diff if any. */
/* Read the final diff if any. */
aofReadDiffFromParent
();
aofReadDiffFromParent
();
...
...
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