During a very long sync, sometimes the source has since deleted files, but q-f-m still tries to transfer them because it doesn't refresh the filelists on rsync retries. Therefore, errors like this appear in the rsync run:
rsync: link_stat "/epel/5/SRPMS/repodata/27c21221ef379dcd3924a30291d0b128a95ad955-other.sqlite.bz2" (in fedora-buffet0) failed: No such file or directory (2)
which cause rsync to exit with code 23:
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1505) [generator=3.0.6]
Log: rsync returned 23 (retryable), sleeping for 128 rsync failed: sleeping for 128
which then causes q-f-m to retry with the same filelist. This will never succeed, hence an infinite loop is created.
I think the problem is a missing dollar sign here on $sleep, which would have broken out of the loop after 10 retries ( log2(1000) == 10 ):
sleep=$(( sleep*2 )) if (( sleep > 1000 )); then
Numeric context doesn't require sigils on variables; the syntax is correct. And for me q-f-m does break out of such loops.
ἐπιθυμία:~❯ aa=1; while true; do echo $aa; aa=$(( aa * 2 )); if (( aa > 1000 )); then break; fi; done 1 2 4 8 16 32 64 128 256 512
Are you sure it ever gives you a "sleeping for 1024" or whatever message? How are you determining that the loop is infinite, as opposed to simply taking longer than you expect?
The retry with backoff thing is really designed to handle the case where the download server is simply overloaded and refusing connections. Sadly it's difficult to determine exactly why a failure was seen using only the rsync return code. 23 in this case would also kick in due to a network timeout or the server terminating the connection, which is definitely something we want to retry. I'm not sure there's a good way out besides either accepting that in some cases you will retry when you can't proceed, or trying to parse rsync's stderr output.
Metadata Update from @tibbs: - Issue assigned to tibbs
So on IRC I think we worked out that it's not really inflooping, you just have a large file list to transfer and so it takes a little bit for each iteration. Will make the retry count configurable.
Correct, this ticket can be closed. Thanks.
Metadata Update from @cra: - Issue close_status updated to: Invalid - Issue status updated to: Closed (was: Open)