Hi,
It appears that dsync closes the file handle once it gets the F (finish) response even if it hasn’t received the X (done) response. If the X (done) response gets delivered in another write this will generate EPIPE in the connected process.
This is much easier to replicate over SSL, however the trace is provided without SSL since its easier to see whats going on.
Thanks J. Nick Koston
# dovecot --version 2.2.24 (a82c823) dovecot-2.2.24-1.x86_64
F\n is in packet 1 X\n is in packet 2
STRACE of an the unexpected EPIPE:
[pid 34753] read(4, "F\n", 524288) = 2
[pid 34753] write(1, "F\n", 2) = 2
[pid 34752] <... epoll_wait resumed> {{EPOLLIN, {u32=42323904, u64=42323904}}}, 3, 3350) = 1
[pid 34753] select(8, [0 4], NULL, NULL, {21600, 0}
STRACE where its in one packet:
F\nX\n is in a single packet
[pid 34833] select(8, [0 4], NULL, NULL, {21600, 0}) = 1 (in [4], left {21599, 999966})
[pid 34833] read(4, "F\nX\n", 524288) = 4
[pid 34833] write(1, "F\nX\n", 4) = 4
[pid 34833] select(8, [0 4], NULL, NULL, {21600, 0}