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
61c78a52
Commit
61c78a52
authored
May 19, 2017
by
antirez
Browse files
Collect fork() timing info only if fork succeeded.
parent
d067e334
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
61c78a52
...
@@ -1690,9 +1690,6 @@ int rdbSaveToSlavesSockets(void) {
...
@@ -1690,9 +1690,6 @@ int rdbSaveToSlavesSockets(void) {
exitFromChild
((
retval
==
C_OK
)
?
0
:
1
);
exitFromChild
((
retval
==
C_OK
)
?
0
:
1
);
}
else
{
}
else
{
/* Parent */
/* Parent */
server
.
stat_fork_time
=
ustime
()
-
start
;
server
.
stat_fork_rate
=
(
double
)
zmalloc_used_memory
()
*
1000000
/
server
.
stat_fork_time
/
(
1024
*
1024
*
1024
);
/* GB per second. */
latencyAddSampleIfNeeded
(
"fork"
,
server
.
stat_fork_time
/
1000
);
if
(
childpid
==
-
1
)
{
if
(
childpid
==
-
1
)
{
serverLog
(
LL_WARNING
,
"Can't save in background: fork: %s"
,
serverLog
(
LL_WARNING
,
"Can't save in background: fork: %s"
,
strerror
(
errno
));
strerror
(
errno
));
...
@@ -1715,6 +1712,10 @@ int rdbSaveToSlavesSockets(void) {
...
@@ -1715,6 +1712,10 @@ int rdbSaveToSlavesSockets(void) {
close
(
pipefds
[
0
]);
close
(
pipefds
[
0
]);
close
(
pipefds
[
1
]);
close
(
pipefds
[
1
]);
}
else
{
}
else
{
server
.
stat_fork_time
=
ustime
()
-
start
;
server
.
stat_fork_rate
=
(
double
)
zmalloc_used_memory
()
*
1000000
/
server
.
stat_fork_time
/
(
1024
*
1024
*
1024
);
/* GB per second. */
latencyAddSampleIfNeeded
(
"fork"
,
server
.
stat_fork_time
/
1000
);
serverLog
(
LL_NOTICE
,
"Background RDB transfer started by pid %d"
,
serverLog
(
LL_NOTICE
,
"Background RDB transfer started by pid %d"
,
childpid
);
childpid
);
server
.
rdb_save_time_start
=
time
(
NULL
);
server
.
rdb_save_time_start
=
time
(
NULL
);
...
...
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