Skip to content

Commit 1c4ff1b

Browse files
sarthakaggarwal97rjd15372
authored andcommitted
Fix closing slot migration pipe read (#2630)
We probably should close the correct `slot_migration_pipe_read`. It should resolve the valgrind errors. Signed-off-by: Sarthak Aggarwal <[email protected]>
1 parent 7612f13 commit 1c4ff1b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/cluster_migrateslots.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ int slotExportJobBeginSnapshotToTargetSocket(slotMigrationJob *job) {
13391339
rioInitWithFd(&aof, slot_migration_pipe_write);
13401340
/* Close the reading part, so that if the parent crashes, the child will
13411341
* get a write error and exit. */
1342-
close(server.rdb_pipe_read);
1342+
close(server.slot_migration_pipe_read);
13431343

13441344
serverSetProcTitle("valkey-slot-migration-to-target");
13451345
serverSetCpuAffinity(server.bgsave_cpulist);
@@ -1370,7 +1370,7 @@ int slotExportJobBeginSnapshotToTargetSocket(slotMigrationJob *job) {
13701370
serverLog(LL_NOTICE, "Started child process %ld for slot migration %s", (long)childpid, job->description);
13711371
close(slot_migration_pipe_write); /* close write in parent so that it can detect the close on the child. */
13721372
if (aeCreateFileEvent(server.el, server.slot_migration_pipe_read, AE_READABLE, slotMigrationPipeReadHandler, NULL) == AE_ERR) {
1373-
serverPanic("Unrecoverable error creating server.rdb_pipe_read file event.");
1373+
serverPanic("Unrecoverable error creating server.slot_migration_pipe_read file event.");
13741374
}
13751375
close(safe_to_exit_pipe);
13761376
if (server.debug_pause_after_fork) debugPauseProcess();

0 commit comments

Comments
 (0)