Bug 1109189 - connection timeouts on slow lines
Summary: connection timeouts on slow lines
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: librepo
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ales Kozumplik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-06-13 12:33 UTC by Thorsten Leemhuis
Modified: 2014-09-30 23:42 UTC (History)
8 users (show)

Fixed In Version: librepo-1.7.4-3.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-30 10:31:11 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thorsten Leemhuis 2014-06-13 12:33:07 UTC
Description of problem:
Dnf now and then bails out as it fails to download packages that firefox is perfectly able to download. I'm seeing it with some slow mirror servers and quite often with repos.fedorapeople.org. 

Example:
"""
Transaction Summary
============================================================================================================================================
Install  3 Packages
Upgrade  4 Packages
Remove   2 Packages

Total size: 29 M
Total download size: 27 M
Downloading Packages:
[SKIPPED] kernel-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: Already downloaded                                                     
[SKIPPED] kernel-modules-extra-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: Already downloaded                                       
(3/7): kernel-headers-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm                                     250 kB/s | 979 kB     00:03    
(4/7): kernel-tools-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm                                        28 kB/s | 171 kB     00:06    
[MIRROR] kernel-modules-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: Curl error: Timeout was reached for http://repos.fedorapeople.org/repos/thl/kernel-vanilla-mainline/fedora-20/x86_64/kernel-modules-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm
[MIRROR] kernel-devel-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: Curl error: Timeout was reached for http://repos.fedorapeople.org/repos/thl/kernel-vanilla-mainline/fedora-20/x86_64/kernel-devel-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm
[FAILED] kernel-modules-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success
Error: Error downloading packages:illa.mainline.kn 68% [==================================                ] 4.0 MB/s |  20 MB     00:02 ETA
  Cannot download kernel-modules-3.15.0-1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: All mirrors were tried
"""

Seconds later I was perfectly able to download said packages with firefox. It took a while, because the server is not the quickest, but it worked just fine. Dnf wasn't able to download the packages even when I tried running it multiple times in a row.

Version-Release number of selected component (if applicable):
$ rpm -q dnf libcurl 
dnf-0.5.2-1.fc20.noarch
libcurl-7.32.0-11.fc20.x86_64

How reproducible:
I'm seeing this for months now. It looked like a minor problem at first, but I'm running into it once in a while at it's really starting to get annoying ;-)
Note: there is a transparent proxy between me and the net, but that is nothing unusual I'd say.

Additional info:
Is there some libcurl timeout that dnf is setting to low? It seems libcurl (and thus dnf) bails out already round about 10 seconds after it started downloading.

Comment 1 Radek Holy 2014-06-13 13:22:47 UTC
Hello, thank you for the report. We'll take a look.

Comment 2 Ales Kozumplik 2014-06-24 08:08:34 UTC
Thorsten, I'm not able to reproduce this using "http://repos.fedorapeople.org/repos/thl/kernel-vanilla-mainline/fedora-20/x86_64/", neither have I heard of other people having problems with fedorapeople.org repos and use few myself. Can you try without the transparent proxy and report the results?

Thank you.

Comment 3 Ales Kozumplik 2014-06-24 08:21:24 UTC
Hmm, digging deeper I see that librepo sets CURLOPT_LOW_SPEED_TIME to 10 seconds and CURLOPT_LOW_SPEED_LIMIT to 1000.

CCing the librepo maintainer. Tomas, could it be the time to bump the default values? Ta'.

Alternative is re-enabling the 'minrate' and 'timeout' options from Yum.

Comment 4 Thorsten Leemhuis 2014-06-24 09:09:56 UTC
A quick comment while we wait for a reply from Tomas

(In reply to Ales Kozumplik from comment #2)
> I'm not able to reproduce this […] using fedorapeople.org repos  […]

Just for clarifiction: It works fine for me most of the time, too; maybe 95 to 98 % of the time, which is not bad, but not really satisfiying I'd say.

>  Can you try without the transparent proxy and report the results?

No, sorry, no way around it here at work, where I've seen the problem most of the time. But I saw it at home, too (no proxy there). It just happens seldomly and is not easy to reproduce; calling dnf again often is enough to work around it.

Comment 5 Ales Kozumplik 2014-06-24 11:51:27 UTC
No worries, after I saw how librepo sets up curl it is easily explainable on the DNF side. I'm just curious whether we can get away by tweaking the defaults or need to have the manual setting.

Comment 6 Tomas Mlcoch 2014-06-24 13:49:13 UTC
Hi,

I can definitely increase the default CURLOPT_LOW_SPEED_TIME, what would you say to 30sec (or maybe 60sec)? - I think this could be reasonable amount of time.

Also, I can reduce the default CURLOPT_LOW_SPEED_LIMIT but I am not sure if it is really necessary, because 1000 bytes per second, which is the current default value, seems to be already pretty low to me.

Moreover, the librepo sets CURLOPT_CONNECTTIMEOUT to only 30sec which also can be source of this troubles (I just found out that there is a bug in the documentation of librepo which says that the default CONNECTTIMEOUT value is 300sec). So I can also increase this value.

To my defense, all current values were chosen in order to provide maximal user comfort: low connect_timeout = quickly skip non-working mirrors, low low_speed_time - quickly skip slow mirrors. But obviously, the values have to be slightly tweaked.

Comment 7 Thorsten Leemhuis 2014-06-25 07:55:48 UTC
(In reply to Tomas Mlcoch from comment #6)

> To my defense, all current values were chosen in order to provide maximal
> user comfort: low connect_timeout = quickly skip non-working mirrors, low
> low_speed_time - quickly skip slow mirrors. But obviously, the values have
> to be slightly tweaked.

Hmmm. Maybe it makes sense to have a codepath with different settings in case there is only one server (or only one left after trying multiple ones)?

Comment 8 Ales Kozumplik 2014-06-26 05:50:47 UTC
(In reply to Tomas Mlcoch from comment #6)
> Hi,
> 
> I can definitely increase the default CURLOPT_LOW_SPEED_TIME, what would you
> say to 30sec (or maybe 60sec)? - I think this could be reasonable amount of
> time.

I think 30s would be a great start.

> 
> Also, I can reduce the default CURLOPT_LOW_SPEED_LIMIT but I am not sure if
> it is really necessary, because 1000 bytes per second, which is the current
> default value, seems to be already pretty low to me.
> 

That's really quite low already, let's not move this one.

Moving to you, thanks.

Comment 9 Fedora Update System 2014-06-26 12:38:37 UTC
librepo-1.7.4-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/librepo-1.7.4-3.fc20

Comment 10 Fedora Update System 2014-06-27 02:26:59 UTC
Package librepo-1.7.4-3.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing librepo-1.7.4-3.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7793/librepo-1.7.4-3.fc20
then log in and leave karma (feedback).

Comment 11 Fedora Update System 2014-06-30 10:31:11 UTC
librepo-1.7.4-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 12 Thorsten Leemhuis 2014-07-01 11:54:45 UTC
FWIW, a quick comment: I'm not sure if this is fixed for real, as I ran into the issue today yet again: """ Cannot download kernel-devel-3.16.0-0.rc3.git0.1.vanilla.mainline.knurd.1.fc20.x86_64.rpm: All mirrors were tried "" (that's a package from http://repos.fedorapeople.org yet again) This is with librepo-1.7.4-3.fc20.x86_64. It worked on the second try, but it makes me really suspcious that I ran into this again so soon...


Note You need to log in before you can comment on or make changes to this bug.