Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
Signed-off-by: naglera <[email protected]>
  • Loading branch information
naglera committed Oct 29, 2024
1 parent b82704f commit 4d8126b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/replication.c
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,8 @@ int readIntoReplDataBlock(connection *conn, replDataBufBlock *data_block, size_t
}
if (nread == 0) {
serverLog(LL_VERBOSE, "Provisional primary closed connection");
if (server.loading_rio) server.loading_rio->flags |= RIO_FLAG_CLOSE_ASAP;
/* Signal ongoing RDB load to terminate gracefully */
if (server.loading_rio) rioCloseASAP(server.loading_rio);
cancelReplicationHandshake(1);
return C_ERR;
}
Expand Down
4 changes: 4 additions & 0 deletions src/rio.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ static inline int rioFlush(rio *r) {
return r->flush(r);
}

static inline void rioCloseASAP(rio *r) {
r->flags |= RIO_FLAG_CLOSE_ASAP;
}

/* This function allows to know if there was a read error in any past
* operation, since the rio stream was created or since the last call
* to rioClearError(). */
Expand Down

0 comments on commit 4d8126b

Please sign in to comment.