Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
"mb scan" may hang, because rsync's "--timeout" option is not #8
Issue migrated (2015-06-05) from old issue tracker http://mirrorbrain.org/issues/issue12
msg31 (view) Author: poeml Date: 2009-10-08.11:50:06
rsync should never hang longer than 20 seconds when we probe for files -- since we run it with --timeout=20.
But this timeout doesn't seem to apply to the connect phase of rsync:
/tmp/mb_probefile_PChalR/ --list-only; } 2>&1
msg32 (view) Author: poeml Date: 2009-10-08.11:50:55
The impact is that this may cause the whole "mb scan" command to hang in the
msg105 (view) Author: poeml Date: 2009-12-11.21:16:57
Incidentally, I discovered in the rsync man page that there's an additional timeout setting:
--contimeout=SECONDS set daemon connection timeout in seconds
...exactly what we need.
It was new in rsync 3.0.0.
Thus, we can use it, except on platforms that still have rsync 2.6. Debian 5.0 is such a case.
So it could be worthwhile to detect the rsync version in the beginning of a scan. The detection can be used
% python -c "import commands; status, output = commands.getstatusoutput('rsync --version'); print status;
Something along these lines needs to be added to mb/testmirror.py.
msg129 (view) Author: poeml Date: 2010-02-10.04:31:22
I committed a fix to trunk (r7953).
(end of migrated issue)