Skip to content

Commit

Permalink
Crash when aborting SYNC with a master on a thread other than main
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Jul 15, 2019
1 parent 971f69f commit a19d0f6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/replication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2198,8 +2198,10 @@ int connectWithMaster(redisMaster *mi) {
void undoConnectWithMaster(redisMaster *mi) {
int fd = mi->repl_transfer_s;

aeDeleteFileEvent(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el,fd,AE_READABLE|AE_WRITABLE);
close(fd);
aePostFunction(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el, [fd]{
aeDeleteFileEvent(g_pserver->rgthreadvar[IDX_EVENT_LOOP_MAIN].el,fd,AE_READABLE|AE_WRITABLE);
close(fd);
});
mi->repl_transfer_s = -1;
}

Expand Down

0 comments on commit a19d0f6

Please sign in to comment.