Listing a non-existent remote directory causes rsync to "hang" (it's not really hung, it's very busy doing nothing...). Current git (5561c14). Listing non-existent file fails as expected: local$ ./rsync-3.1.0dev-5561c14-x64 --rsync-path=/tmp/rsync-3.1.0dev-5561c14-x64 remote:/tmp/foo rsync: link_stat "/tmp/foo" failed: No such file or directory (2) rsync error: some files/attrs were not transferred (see previous errors) (code 23) at ../rsync/main.c(1635) [Receiver=3.1.0dev-5561c14] rsync: [Receiver] write error: Broken pipe (32) local$ Listing non-existent directory doesn't return: local$ ./rsync-3.1.0dev-5561c14-x64 --rsync-path=/tmp/rsync-3.1.0dev-5561c14-x64 remote:/tmp/foo/ rsync: change_dir "/tmp/foo" failed: No such file or directory (2) Strace of local side: local$ strace -p ${pid} select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 select(0, NULL, NULL, NULL, {0, 20000}) = 0 (Timeout) wait4(20466, 0x7fffe3bd3f7c, WNOHANG, NULL) = 0 [...continues very quicky] Strace of remote side: remote$ strace -p ${pid} Process 8398 attached - interrupt to quit select(1, [0], [], [0], {11, 434460}) = 0 (Timeout) select(2, [0], [1], [0], {30, 0}) = 1 (out [1], left {29, 999997}) write(1, "\0\0\0\7", 4) = 4 select(1, [0], [], [0], {30, 0} (Timeout) select(2, [0], [1], [0], {30, 0}) = 1 (out [1], left {29, 999997}) write(1, "\0\0\0\7", 4) = 4 select(1, [0], [], [0], {30, 0} [...continues slowly]
In the case where the chdir failed, rsync was setting an I/O error prior to aborting (due to an empty file list), and that would trigger an attempt to stick around waiting for a clean exit, even though it hadn't output enough protocol data to tell the remote side everything was done. I have changed the code to force this premature exit to exit w/o delay. I should probably revisit this empty-flist abnormal exit sequence in order to make the protocol behave more cleanly, but this fix is good enough for now. Thanks for the report!