Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 523312 - app-portage/mirrorselect-2.2.2 - mirrorselect.selectors.TimeoutException
Summary: app-portage/mirrorselect-2.2.2 - mirrorselect.selectors.TimeoutException
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage Tools Team
URL:
Whiteboard:
Keywords: InVCS
: 599616 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-09-20 18:00 UTC by Alex Efros
Modified: 2018-01-11 20:37 UTC (History)
5 users (show)

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


Attachments
deeptime: cancel alarm signal before handling socket.error (0001-deeptime-cancel-alarm-signal-before-handling-socket..patch,1.84 KB, patch)
2016-11-14 07:23 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Efros 2014-09-20 18:00:09 UTC
While trying to install gentoo using install CD:

livecd gentoo # mirrorselect -s 5 -b 10 -t 3 -D -H -4 -o >> /mnt/gentoo/etc/portage/make.conf
* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Limiting test to http hosts. 
* Downloading a list of mirrors...
 Got 192 mirrors.
* Downloading mirrorselect-test files from each mirror... [52 of 90]Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/mirrorselect", line 61, in <module>
    MirrorSelect().main(sys.argv)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/main.py", line 375, in main
    urls = self.select_urls(hosts, options)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/main.py", line 324, in select_urls
    selector = Deep(hosts, options, self.output)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 226, in __init__
    self.deeptest()
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 253, in deeptest
    mytime, ignore = self.deeptime(host, maxtime)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 305, in deeptime
    addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG):
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 199, in timeout_handler
    raise TimeoutException()
mirrorselect.selectors.TimeoutException
livecd gentoo #
Comment 1 Dennis Schridde 2014-11-09 14:36:08 UTC
Same issue:
# mirrorselect -s3 -D
* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Downloading a list of mirrors...
 Got 192 mirrors.
* Downloading mirrorselect-test files from each mirror... [146 of 192]Traceback (most recent call last):
  File "/usr/lib64/python3.4/site-packages/mirrorselect/selectors.py", line 305, in deeptime
    addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG):
  File "/usr/lib64/python3.4/socket.py", line 530, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Temporary failure in name resolution

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.4/mirrorselect", line 61, in <module>
    MirrorSelect().main(sys.argv)
  File "/usr/lib64/python3.4/site-packages/mirrorselect/main.py", line 375, in main
    urls = self.select_urls(hosts, options)
  File "/usr/lib64/python3.4/site-packages/mirrorselect/main.py", line 324, in select_urls
    selector = Deep(hosts, options, self.output)
  File "/usr/lib64/python3.4/site-packages/mirrorselect/selectors.py", line 226, in __init__
    self.deeptest()
  File "/usr/lib64/python3.4/site-packages/mirrorselect/selectors.py", line 253, in deeptest
    mytime, ignore = self.deeptime(host, maxtime)
  File "/usr/lib64/python3.4/site-packages/mirrorselect/selectors.py", line 305, in deeptime
    addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG):
  File "/usr/lib64/python3.4/site-packages/mirrorselect/selectors.py", line 199, in timeout_handler
    raise TimeoutException()
mirrorselect.selectors.TimeoutException
Comment 2 Garry Filakhtov 2015-01-04 19:12:46 UTC
# mirrorselect -s5 -b10 -o -D

* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Downloading a list of mirrors...
 Got 186 mirrors.
* Downloading mirrorselect-test files from each mirror... [58 of 186]Traceback (most recent call last):
  File "/usr/lib/python-exec/python2.7/mirrorselect", line 61, in <module>
    MirrorSelect().main(sys.argv)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/main.py", line 375, in main
    urls = self.select_urls(hosts, options)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/main.py", line 324, in select_urls
    selector = Deep(hosts, options, self.output)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 226, in __init__
    self.deeptest()
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 253, in deeptest
    mytime, ignore = self.deeptime(host, maxtime)
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 305, in deeptime
    addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG):
  File "/usr/lib64/python2.7/site-packages/mirrorselect/selectors.py", line 199, in timeout_handler
    raise TimeoutException()
mirrorselect.selectors.TimeoutException

Same here.
Unable to finish the scanning to get mirrors for rotation.
Comment 3 jms 2015-02-09 07:37:24 UTC
same here
mirrorselect -s3 -b10 -o -D >> /etc/portage/make.conf
* Using url: https://api.gentoo.org/mirrors/distfiles.xml
* Downloading a list of mirrors...
 Got 185 mirrors.
* Downloading mirrorselect-test files from each mirror... [26 of 185]Traceback (most recent call last):
  File "/usr/lib64/python3.3/site-packages/mirrorselect/selectors.py", line 305, in deeptime
    addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG):
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python-exec/python3.3/mirrorselect", line 61, in <module>
    MirrorSelect().main(sys.argv)
  File "/usr/lib64/python3.3/site-packages/mirrorselect/main.py", line 375, in main
    urls = self.select_urls(hosts, options)
  File "/usr/lib64/python3.3/site-packages/mirrorselect/main.py", line 324, in select_urls
    selector = Deep(hosts, options, self.output)
  File "/usr/lib64/python3.3/site-packages/mirrorselect/selectors.py", line 226, in __init__
    self.deeptest()
  File "/usr/lib64/python3.3/site-packages/mirrorselect/selectors.py", line 253, in deeptest
    mytime, ignore = self.deeptime(host, maxtime)
  File "/usr/lib64/python3.3/site-packages/mirrorselect/selectors.py", line 305, in deeptime
    addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG):
  File "/usr/lib64/python3.3/site-packages/mirrorselect/selectors.py", line 199, in timeout_handler
    raise TimeoutException()
mirrorselect.selectors.TimeoutException
Comment 4 jms 2015-02-14 16:24:29 UTC
problem for me is option -D
works fine without it.
myconexion is
Download ~8.52 Mbps
Upload 0,87 Mbps.

would this have anything to do with :
Bug 503638 ?
Comment 5 jms 2015-11-25 09:24:10 UTC
well just increasing the timeout from default 10secondes to 20 solve the issue
 mirrorselect -s3 -b10 -o -D -t20

may this should be a default
still think mirrorselect shouldn't raise a mirrorselect.selectors.TimeoutException

and be able to finish its task
Comment 6 Zac Medico gentoo-dev 2016-11-14 07:00:59 UTC
*** Bug 599616 has been marked as a duplicate of this bug. ***
Comment 7 Zac Medico gentoo-dev 2016-11-14 07:04:53 UTC
(In reply to jms from comment #5)
> well just increasing the timeout from default 10secondes to 20 solve the
> issue
>  mirrorselect -s3 -b10 -o -D -t20

Yeah that makes sense, because it seems that with the default 10 second timeout, TimeoutException sometime triggers while the socket.gaierror is being handled. It's a race-condition.
Comment 8 Zac Medico gentoo-dev 2016-11-14 07:23:09 UTC
Created attachment 453268 [details, diff]
deeptime: cancel alarm signal before handling socket.error

In order to avoid a race condition, the alarm signal must be cancelled
before socket.error is handled.
Comment 9 Brian Dolbec (RETIRED) gentoo-dev 2016-11-14 21:39:20 UTC
Thanks Zac, patch looks good.   Can you push it?
Comment 11 Brian Dolbec (RETIRED) gentoo-dev 2016-11-15 22:24:11 UTC
for those of that wish to get this fix right away:

emerge =app-portage/mirrorselect-9999

or add the attached patch to /etc/portage/patches/app-portage/mirrorselect/
 and re-emerge the latest version.
Comment 12 Chris Wood 2016-12-01 17:34:00 UTC
This bug is trivial to fix
Please can someone with access edit the source of
https://api.gentoo.org/mirrors/distfiles.xml

The lines below need the </url> replacing with </uri>
<uri protocol="http" ipv4="y" ipv6="y" partial="n">http://mirror.dkm.cz/gentoo/</url>
<uri protocol="http" ipv4="y" ipv6="y" partial="n">https://mirror.dkm.cz/gentoo/</url>
<uri protocol="ftp" ipv4="y" ipv6="y" partial="n">ftp://mirror.dkm.cz/gentoo/</url>
Comment 13 Chris Wood 2016-12-01 17:36:20 UTC
(In reply to Chris Wood from comment #12)
> This bug is trivial to fix
> Please can someone with access edit the source of
> https://api.gentoo.org/mirrors/distfiles.xml
> 
> The lines below need the </url> replacing with </uri>
> <uri protocol="http" ipv4="y" ipv6="y"
> partial="n">http://mirror.dkm.cz/gentoo/</url>
> <uri protocol="http" ipv4="y" ipv6="y"
> partial="n">https://mirror.dkm.cz/gentoo/</url>
> <uri protocol="ftp" ipv4="y" ipv6="y"
> partial="n">ftp://mirror.dkm.cz/gentoo/</url>

My mistake this is another bug with similar output
Comment 14 Zac Medico gentoo-dev 2018-01-11 20:37:30 UTC
This was released in mirrorselect-2.2.3.