Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 453268 Details for
Bug 523312
app-portage/mirrorselect-2.2.2 - mirrorselect.selectors.TimeoutException
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
deeptime: cancel alarm signal before handling socket.error
0001-deeptime-cancel-alarm-signal-before-handling-socket..patch (text/plain), 1.84 KB, created by
Zac Medico
on 2016-11-14 07:23:09 UTC
(
hide
)
Description:
deeptime: cancel alarm signal before handling socket.error
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2016-11-14 07:23:09 UTC
Size:
1.84 KB
patch
obsolete
>From 39be1fad873770cd840e67f09722bfb11baea543 Mon Sep 17 00:00:00 2001 >From: Zac Medico <zmedico@gentoo.org> >Date: Sun, 13 Nov 2016 23:16:51 -0800 >Subject: [PATCH] deeptime: cancel alarm signal before handling socket.error > (bug 523312) > >In order to avoid a race condition, the alarm signal must be cancelled >before socket.error is handled. > >X-Gentoo-Bug: 523312 >X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=523312 >--- > mirrorselect/selectors.py | 22 ++++++++++++---------- > 1 file changed, 12 insertions(+), 10 deletions(-) > >diff --git a/mirrorselect/selectors.py b/mirrorselect/selectors.py >index 1aa5f11..cf70b21 100644 >--- a/mirrorselect/selectors.py >+++ b/mirrorselect/selectors.py >@@ -300,22 +300,24 @@ class Deep(object): > ips = [] > for addr_family in self._addr_families: > try: >- signal.alarm(self._dns_timeout) >- for result in socket.getaddrinfo(url_parts.hostname, None, >- addr_family, socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG): >- family, _, __, ___, sockaddr = result >- ip = sockaddr[0] >- if family == socket.AF_INET6: >- ip = "[%s]" % ip >- ips.append(ip) >+ try: >+ signal.alarm(self._dns_timeout) >+ for result in socket.getaddrinfo( >+ url_parts.hostname, None, addr_family, >+ socket.SOCK_STREAM, 0, socket.AI_ADDRCONFIG): >+ family, _, __, ___, sockaddr = result >+ ip = sockaddr[0] >+ if family == socket.AF_INET6: >+ ip = "[%s]" % ip >+ ips.append(ip) >+ finally: >+ signal.alarm(0) > except socket.error as e: > self.output.write('deeptime(): dns error for host %s: %s\n' > % (url_parts.hostname, e), 2) > except TimeoutException: > self.output.write('deeptime(): dns timeout for host %s\n' > % url_parts.hostname, 2) >- finally: >- signal.alarm(0) > > if not ips: > self.output.write('deeptime(): unable to resolve ip for host %s\n' >-- >2.7.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 523312
: 453268