rsync dead loop (almost) forever in read_timeout() if remote host down

Ming Zhang blackmagic02881 at
Fri Dec 14 16:42:58 GMT 2007

Hi All

This can be reproduced easily. run rsync under gdb and set a break point
at read_timeout(). then after rsync talk with remote rsync daemon and
stop at this function, turn off remote machine directly. then let rsync
run and it will run forever in this function.

if we just kill remote rsync daemon, it is fine and quickly detected,
because OS do clean up work. But if power off the box directly. a half
open socket is left at rsync client side.

i know rsync set KEEPALIVE, but on my RHEL4 box, rsync still loop in the
function after 3 hours.... maybe KEEPALIVE in OS is broken. but can
rsync have an application level heatbeat to detect such failure?

Ming Zhang

@#$%^ purging memory... (*!%

More information about the rsync mailing list