core: set O_NONBLOCK on every side. Closes #33
The last time I tested set_nonblock() as a fix for the rsync hang, I used F_SETFD rather than F_SETFL, which resulted in no error, but also did not set O_NONBLOCK. Turns out missing O_NONBLOCK was the problem. The rsync hang was due to every context blocking in os.write() waiting for either a parent or child buffer to empty, which was exacerbated by rsync's own pipelining, that allows writes from both sides to proceed even while reads aren't progressing. The hang was due to os.write() on a blocking fd blocking until buffer space is available to complete the write. Partial writes are only supported when O_NONBLOCK is enabled.
Showing
Please register or sign in to comment