#991299 clamav-freshclam: Default download timeout short, retrying download endlessly

Package:
clamav-freshclam
Source:
clamav
Description:
anti-virus utility for Unix - virus database update utility
Submitter:
Mara Sophie Grosch
Date:
2021-09-20 14:39:03 UTC
Severity:
normal
#991299#5
Date:
2021-07-20 09:10:47 UTC
From:
To:
Dear Maintainer,

yesterday I noticed my laptop having a lot of internet traffic from
cloudflare, but could not find what was the reason for it. Today I
enabled IP accounting and while looking at the journal (to check if a
`daemon-reload` is enough), I saw `freshclam` warning about missed
timeouts and retried downloads.

After stopping the `clamav-freshclam.service` and doing a manual
`sudo freshclam`, I saw the problem: it's configured by default to
timeout the download after 30s and then retries to download.

I'm currently at a location with a not-very-fast internet connection, so
the 30s just are not enough time to download the ~160MB it wanted to
retrieve.

I changed the ReceiveTimeout from 30 to 120, this allowed me to download
the updated database with my current connection.

I'd suggest any or both of these changes:

   * increase default timeout, best by not setting one at all
   * do not retry immediately after a missed timeout

Some days ago I used a metered connection. This only slows down after
the allowed data volume is used up, but maybe it was faster used up
because of this - so can be quite frustrating to users, especially since
it happens in the background.

Having a reverse DNS for the IP would have helped a bit, but since it's
cloudflare, it probably isn't used for clamav database only, so the info
it can give is limited..

Thank you for putting your time into this and best regards
Mara Sophie Grosch
--- data dir ---
total 342204
-rw-r--r-- 1 clamav clamav   1438720 May 31 17:48 bytecode.cld
-rw-r--r-- 1 clamav clamav 180754944 Jul 19 11:01 daily.cld
-rw-r--r-- 1 clamav clamav 168205379 Jul 20 10:57 main.cvd
-rw------- 1 clamav clamav        69 Jul 17 16:03 mirrors.dat

#991299#10
Date:
2021-07-20 09:26:36 UTC
From:
To:
Hi again and sorry for the noise,

I checked the other open bug reports before, but somehow missed this to
be partly-duplicate of #690788

The problem is the same, the proposed "solutions" are different.
Resuming the partial download is probably a real solution, while my
proposals are easy, but more "workaroundy"

Anyway, just wanted to add the link to the existing bug

#991299#15
Date:
2021-09-20 14:27:38 UTC
From:
To:
Hello,

had the same issue yesterday also. Increased the timeout value to two minutes, which helped. Maybe this should be changed by an update through ucf: Most users install clamav and don't care anymore. I'm sure the load for the CDN through repeated tries not being finished in 30 seconds is substantial.

Especially a backoff time seems to be desirable to not run into blocked state with the accompanying cool-down from the CDN.

I'm not sure if this belongs here or is a sole upstream issue.

:wq! PoC