valkey icon indicating copy to clipboard operation
valkey copied to clipboard

Dual-channel-replication: set connection to blocking in child process

Open xbasel opened this issue 1 year ago • 2 comments

Dual-channel file descriptors are set to blocking mode in the main thread, followed by a blocking write. This sets the file descriptors to non-blocking if TLS is used (see connTLSSyncWrite()).

The child process assumes all file descriptors are in blocking mode, so a short-write leads to errors in the replica while loading the RDB.

This change sets file descriptors to blocking in the child process.

xbasel avatar Aug 01 '24 16:08 xbasel

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.38%. Comparing base (b728e41) to head (f0aaae3). Report is 50 commits behind head on unstable.

Files Patch % Lines
src/replication.c 50.00% 1 Missing :warning:
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #862      +/-   ##
============================================
- Coverage     70.47%   70.38%   -0.09%     
============================================
  Files           112      112              
  Lines         61467    61471       +4     
============================================
- Hits          43320    43269      -51     
- Misses        18147    18202      +55     
Files Coverage Δ
src/rdb.c 76.24% <100.00%> (-0.12%) :arrow_down:
src/replication.c 87.18% <50.00%> (-0.17%) :arrow_down:

... and 11 files with indirect coverage changes

codecov[bot] avatar Aug 01 '24 16:08 codecov[bot]

@xbasel We can close this right?

madolson avatar Aug 15 '24 04:08 madolson

i see #837 does not have this change, do we still need it? @naglera

enjoy-binbin avatar Aug 27 '24 04:08 enjoy-binbin

closing as was already implemented as part of #837

ranshid avatar Aug 27 '24 08:08 ranshid