summaryrefslogtreecommitdiff
path: root/src/childinfo.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-01-08 23:35:30 +0200
committerGitHub <noreply@github.com>2021-01-08 23:35:30 +0200
commit8dd16caec833aebde3a12c7d7f9b6456554c8616 (patch)
tree858520e83b712d5c39097e8a046e127ccad83286 /src/childinfo.c
parentea5350c5ecb08d8915bd59b2dc98982454adc9f7 (diff)
downloadredis-8dd16caec833aebde3a12c7d7f9b6456554c8616.tar.gz
Fix last COW INFO report, Skip test on non-linux platforms (#8301)
- the last COW report wasn't always read from the pipe (receiveLastChildInfo wasn't used) - but in fact, there's no reason we won't always try to drain that pipe so i'm unifying receiveLastChildInfo with receiveChildInfo - adjust threshold of the COW test when run in accurate mode - add some prints in case this test fails again - fix indentation, page size, and PID! in MacOS proc info p.s. it seems that pri_pages_dirtied is always 0
Diffstat (limited to 'src/childinfo.c')
-rw-r--r--src/childinfo.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/childinfo.c b/src/childinfo.c
index 85adfe2f6..cae73fe46 100644
--- a/src/childinfo.c
+++ b/src/childinfo.c
@@ -127,21 +127,9 @@ void receiveChildInfo(void) {
int process_type;
int on_exit;
size_t cow_size;
- if (readChildInfo(&process_type, &on_exit, &cow_size)) {
- updateChildInfo(process_type, on_exit, cow_size);
- }
-}
-
-/* Receive last COW data from child. */
-void receiveLastChildInfo(void) {
- if (server.child_info_pipe[0] == -1) return;
-
- /* Drain the pipe and update child info */
- int process_type;
- int on_exit;
- size_t cow_size;
- while (readChildInfo(&process_type, &on_exit, &cow_size) > 0) {
+ /* Drain the pipe and update child info so that we get the final message. */
+ while (readChildInfo(&process_type, &on_exit, &cow_size)) {
updateChildInfo(process_type, on_exit, cow_size);
}
}