rsync icon indicating copy to clipboard operation
rsync copied to clipboard

Network I/O deadlock

Open LynxChaus opened this issue 3 years ago • 0 comments

When using fast network with dumb transport (debian netcat-traditional in my case) and sender with slow disk - sender rsync may hung with I/O deadlock. Using --blocking-io switch make this thing easily debbugable. While sender slowly traverse and stat files in directories - receiver send data and fully fill iobuf.in buffer. But stupid netcat don't use select() for write fd and simply use write() which block inside kernel (or without --blocking-io it try write again and again and exit after 8192 unsuccessful tries). And now - I/O is dead - rsync try to send data from full iobuff.out to network, but transport locked in kernel while writing data to rsync. iobuf.in already full, perform_io() loops truing only write(). Increasing IO_BUFFER_SIZE to 256k helps.

LynxChaus avatar Nov 17 '21 20:11 LynxChaus