MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / openChildInfoPipe

Function openChildInfoPipe

src/childinfo.cpp:44–55  ·  view source on GitHub ↗

Open a child-parent channel used in order to move information about the * RDB / AOF saving process from the child to the parent (for instance * the amount of copy on write memory used) */

Source from the content-addressed store, hash-verified

42 * RDB / AOF saving process from the child to the parent (for instance
43 * the amount of copy on write memory used) */
44void openChildInfoPipe(void) {
45 serverAssert(g_pserver->child_info_pipe[0] == -1);
46 if (pipe(g_pserver->child_info_pipe) == -1) {
47 /* On error our two file descriptors should be still set to -1,
48 * but we call anyway closeChildInfoPipe() since can't hurt. */
49 closeChildInfoPipe();
50 } else if (anetNonBlock(NULL,g_pserver->child_info_pipe[0]) != ANET_OK) {
51 closeChildInfoPipe();
52 } else {
53 g_pserver->child_info_nread = 0;
54 }
55}
56
57/* Close the pipes opened with openChildInfoPipe(). */
58void closeChildInfoPipe(void) {

Callers 3

launchRdbSaveThreadFunction · 0.85
rdbSaveToSlavesSocketsFunction · 0.85
redisForkFunction · 0.85

Calls 2

closeChildInfoPipeFunction · 0.85
anetNonBlockFunction · 0.85

Tested by

no test coverage detected