Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 274935 - app-portage/mirrorselect INCREDIBLY slow
Summary: app-portage/mirrorselect INCREDIBLY slow
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-06-21 12:31 UTC by lordcris
Modified: 2009-06-21 21:35 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
timeout when closing the initial "wakeup" connection (deeptime_close_timeout.patch,899 bytes, patch)
2009-06-21 19:06 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description lordcris 2009-06-21 12:31:48 UTC
mirrorselect -s3 -b10 -o -D 
takes 2 hours to complete

Reproducible: Always

Steps to Reproduce:
emerge =app-portage/mirrorselect=1.4.1
mirrorselect -s3 -b10 -o -D
Comment 1 lordcris 2009-06-21 12:32:55 UTC
 mirrorselect -s3 -b10 -o -D -d
getlist(): fetching http://www.gentoo.org/main/en/mirrors.xml?passthru=1
* Downloading a list of mirrors... Got 258 mirrors.
Extractor(): fetched mirrors.xml, 258 hosts before filtering
* Downloading 100k files from each mirror... [1 of 217]
_deeptime(): maxtime is 10
deeptime(): download completed.
deeptime(): 1.47979307175 seconds for host ftp://gentoo.arcticnetwork.ca/pub/gentoo/distfiles/mirrorselect-test
_list_add(): added host ftp://gentoo.arcticnetwork.ca/pub/gentoo/. with a time of 1.47979307175
_list_add(): host_dict is not full yet. reusing timeout of 10 sec.
_list_add(): new max time is 10 seconds, and now len(host_dict)= 1
* Downloading 100k files from each mirror... [2 of 217]
_deeptime(): maxtime is 10
deeptime(): download completed.
deeptime(): 0.367179870605 seconds for host http://gentoo.arcticnetwork.ca/distfiles/mirrorselect-test
_list_add(): added host http://gentoo.arcticnetwork.ca/. with a time of 0.367179870605
_list_add(): host_dict is not full yet. reusing timeout of 10 sec.
_list_add(): new max time is 10 seconds, and now len(host_dict)= 2
* Downloading 100k files from each mirror... [3 of 217]
_deeptime(): maxtime is 10
deeptime(): download completed.
deeptime(): 1.70333886147 seconds for host ftp://mirrors.tera-byte.com/pub/gentoo/distfiles/mirrorselect-test
_list_add(): added host ftp://mirrors.tera-byte.com/pub/gentoo. with a time of 1.70333886147
_list_add(): host_dict is full. Selecting the best timeout
_list_add(): new max time is 1.70333886147 seconds, and now len(host_dict)= 3
* Downloading 100k files from each mirror... [4 of 217]
_deeptime(): maxtime is 1.70333886147
deeptime(): download completed.
deeptime(): 0.366360902786 seconds for host http://gentoo.mirrors.tera-byte.com/distfiles/mirrorselect-test
_list_add(): Adding host http://gentoo.mirrors.tera-byte.com/ with a time of 0.366360902786
_list_add(): removing ftp://mirrors.tera-byte.com/pub/gentoo
_list_add(): host_dict is full. Selecting the best timeout
_list_add(): new max time is 1.47979307175 seconds, and now len(host_dict)= 3
* Downloading 100k files from each mirror... [5 of 217]
_deeptime(): maxtime is 1.47979307175
deeptime(): download completed.
deeptime(): 0.307488918304 seconds for host http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/distfiles/mirrorselect-test
_list_add(): Adding host http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ with a time of 0.307488918304
_list_add(): removing ftp://gentoo.arcticnetwork.ca/pub/gentoo/
_list_add(): host_dict is full. Selecting the best timeout
_list_add(): new max time is 0.367179870605 seconds, and now len(host_dict)= 3
* Downloading 100k files from each mirror... [6 of 217]
_deeptime(): maxtime is 0.367179870605

  # And it hangs!
Comment 2 Zac Medico gentoo-dev 2009-06-21 17:59:36 UTC
It sounds as if it got hung on one of the servers (probably ftp://gentoo.arcticnetwork.ca). That server seems to be responding now. Can you still reproduce it now?

Anyway, mirrorselect is supposed to timeout if a server doesn't respond, so I'll have to audit the code to see if I can find a spot where it connects without a timeout.
Comment 3 lordcris 2009-06-21 18:11:01 UTC
hi,
i don't think the problem is ftp://gentoo.arcticnetwork.ca/pub/gentoo/ because I access to it fine. 
but mirrorselect still hangs on the same point:

 mirrorselect -s3 -b10 -o -D -d
getlist(): fetching http://www.gentoo.org/main/en/mirrors.xml?passthru=1
* Downloading a list of mirrors... Got 258 mirrors.
Extractor(): fetched mirrors.xml, 258 hosts before filtering
* Downloading 100k files from each mirror... [1 of 217]
_deeptime(): maxtime is 10
deeptime(): download completed.
deeptime(): 1.47625112534 seconds for host ftp://gentoo.arcticnetwork.ca/pub/gentoo/distfiles/mirrorselect-test
_list_add(): added host ftp://gentoo.arcticnetwork.ca/pub/gentoo/. with a time of 1.47625112534
_list_add(): host_dict is not full yet. reusing timeout of 10 sec.
_list_add(): new max time is 10 seconds, and now len(host_dict)= 1
* Downloading 100k files from each mirror... [2 of 217]
_deeptime(): maxtime is 10
deeptime(): download completed.
deeptime(): 0.366876125336 seconds for host http://gentoo.arcticnetwork.ca/distfiles/mirrorselect-test
_list_add(): added host http://gentoo.arcticnetwork.ca/. with a time of 0.366876125336
_list_add(): host_dict is not full yet. reusing timeout of 10 sec.
_list_add(): new max time is 10 seconds, and now len(host_dict)= 2
* Downloading 100k files from each mirror... [3 of 217]
_deeptime(): maxtime is 10
deeptime(): download completed.
deeptime(): 1.71619009972 seconds for host ftp://mirrors.tera-byte.com/pub/gentoo/distfiles/mirrorselect-test
_list_add(): added host ftp://mirrors.tera-byte.com/pub/gentoo. with a time of 1.71619009972
_list_add(): host_dict is full. Selecting the best timeout
_list_add(): new max time is 1.71619009972 seconds, and now len(host_dict)= 3
* Downloading 100k files from each mirror... [4 of 217]
_deeptime(): maxtime is 1.71619009972
deeptime(): download completed.
deeptime(): 0.390762090683 seconds for host http://gentoo.mirrors.tera-byte.com/distfiles/mirrorselect-test
_list_add(): Adding host http://gentoo.mirrors.tera-byte.com/ with a time of 0.390762090683
_list_add(): removing ftp://mirrors.tera-byte.com/pub/gentoo
_list_add(): host_dict is full. Selecting the best timeout
_list_add(): new max time is 1.47625112534 seconds, and now len(host_dict)= 3
* Downloading 100k files from each mirror... [5 of 217]
_deeptime(): maxtime is 1.47625112534
deeptime(): download completed.
deeptime(): 0.244431018829 seconds for host http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/distfiles/mirrorselect-test
_list_add(): Adding host http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/ with a time of 0.244431018829
_list_add(): removing ftp://gentoo.arcticnetwork.ca/pub/gentoo/
_list_add(): host_dict is full. Selecting the best timeout
_list_add(): new max time is 0.390762090683 seconds, and now len(host_dict)= 3
* Downloading 100k files from each mirror... [6 of 217]
_deeptime(): maxtime is 0.390762090683

Comment 4 Zac Medico gentoo-dev 2009-06-21 19:06:20 UTC
Created attachment 195385 [details, diff]
timeout when closing the initial "wakeup" connection

If this patch is saved as /tmp/deeptime_close_timeout.patch, then it can be applied as follows:

  patch /usr/sbin/mirrorselect /tmp/deeptime_close_timeout.patch

That should fix it, because that's the only network access I see in that area without a timeout.
Comment 5 lordcris 2009-06-21 19:15:54 UTC
that fixed it!
good job!
Comment 6 Zac Medico gentoo-dev 2009-06-21 21:35:35 UTC
Thanks for reporting/testing. This is fixed in mirrorselect-1.4.2.