Your message dated Mon, 12 Nov 2012 22:17:58 +0000
with message-id <e1ty2km-0000i1...@franck.debian.org>
and subject line Bug#690851: fixed in python-gevent 0.13.6-1+nmu1
has caused the Debian Bug report #690851,
regarding IPv6 DNS broken in gevent
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
690851: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690851
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: python-gevent
Version: 0.13.6-1
Severity: grave
Tags: patch

Dear maintainer,

as somewhere else upstream stated themselves (I have forgotten the URL where they did) that gevent.dns is somewhat completely broken in 0.13.6 (which is based on libevent, and they say it is broken there), I recommend using 1.0b1 for wheezy instead.

I use python-gevent for python-x2go intensively and the performance is much better with 1.0b1 and stability has also improved (the used event library is libev now).

One issue is that IPv6 DNS resolution does not work with 0.13.6 at all. As the world moves towards IPv6 (esp. in non-US and non-European parts of the world) I consider this issue as somewhat grave.

Attached is a patch that tries to fix this behaviour for gevent 0.13.6. The patch is not perfect, sometimes you have to wait quite long for name resolution of IPv6 addresses, but at the end they finally resolve. Much better would be a transition to 1.0b1 for wheezy (though the RT may not like this...).


Reproduce (IPv6-only host):
===========================
"""
mike@fylgja:~ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import gevent.socket
gevent.socket.gethostbyname("minobo.das-netzwerkteam.de")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/gevent/socket.py", line 683, in gethostbyname
    _ttl, addrs = resolve_ipv4(hostname)
  File "/usr/lib/pymodules/python2.6/gevent/dns.py", line 59, in resolve_ipv4
    raise DNSError(result)
gevent.dns.DNSError: [Errno 67] request timed out
"""

Should be:::
"""
mike@fylgja:~$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import gevent
import gevent.socket
gevent.socket.gethostbyname("minobo.das-netzwerkteam.de")
'2001:6f8:900:e5d::2'
"""

Reproduce (IPv4/IPv6 host): (first request is IPv4, second request times out)
===========================
"""
mike@fylgja:~$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import gevent.socket
gevent.socket.gethostbyname("vidar.das-netzwerkteam.de")
'178.63.100.242'
gevent.socket.gethostbyname("vidar.das-netzwerkteam.de")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
File "/usr/lib/pymodules/python2.6/gevent/socket.py", line 683, in gethostbyname
    _ttl, addrs = resolve_ipv4(hostname)
  File "/usr/lib/pymodules/python2.6/gevent/dns.py", line 59, in resolve_ipv4
    raise DNSError(result)
gevent.dns.DNSError: [Errno 67] request timed out
"""

Should be:::
"""
mike@fylgja:~$ python
Python 2.6.6 (r266:84292, Dec 26 2010, 22:31:48)
[GCC 4.4.5] on linux2
Type "help", "copyright", "credits" or "license" for more information.
import gevent
import gevent.socket
gevent.socket.gethostbyname("vidar.das-netzwerkteam.de")
'2a01:4f8:121:5085:250:56ff:fe15:236e'
"""

With 1.0b1 the above tests work like a charm. With my provided patch applied to 0.13.6 it works, but with some serious time delays.

Mike


--

DAS-NETZWERKTEAM
mike gabriel, rothenstein 5, 24214 neudorf-bornstein
fon: +49 (1520) 1976 148

GnuPG Key ID 0x25771B31
mail: mike.gabr...@das-netzwerkteam.de, http://das-netzwerkteam.de

freeBusy:
https://mail.das-netzwerkteam.de/freebusy/m.gabriel%40das-netzwerkteam.de.xfb
Nur in python-gevent-0.13.6.patched//gevent: __init__.pyc.
diff -ur python-gevent-0.13.6/gevent/socket.py python-gevent-0.13.6.patched//gevent/socket.py
--- python-gevent-0.13.6/gevent/socket.py	2011-05-17 16:02:29.000000000 +0200
+++ python-gevent-0.13.6.patched//gevent/socket.py	2012-10-18 16:06:41.000000000 +0200
@@ -680,8 +680,14 @@
             return hostname
         if hostname == _socket.gethostname():
             return _socket.gethostbyname(hostname)
-        _ttl, addrs = resolve_ipv4(hostname)
-        return inet_ntoa(random.choice(addrs))
+        addrs = None
+        try:
+            _ttl, addrs = resolve_ipv4(hostname)
+        except:
+            _ttl, addrs = resolve_ipv6(hostname)
+            return inet_ntop(AF_INET6, random.choice(addrs))
+        else:
+            return inet_ntop(AF_INET, random.choice(addrs))
 
     def getaddrinfo(host, port, family=0, socktype=0, proto=0, flags=0, evdns_flags=0):
         """*Some* approximation of :func:`socket.getaddrinfo` implemented using :mod:`gevent.dns`.
@@ -750,30 +756,28 @@
                 for socktype, proto in socktype_proto:
                     result.append((family, socktype, proto, '', sockaddr))
         else:
-            failure = None
-            job = spawn(wrap_errors(gaierror, resolve_ipv6), host, evdns_flags)
+
+            ipv4_res = None
+            ipv6_res = None
             try:
-                try:
-                    ipv4_res = resolve_ipv4(host, evdns_flags)[1]
-                except gaierror, failure:
-                    ipv4_res = None
-                ipv6_res = job.get()
-                if isinstance(ipv6_res, gaierror):
-                    ipv6_res = None
-                    if failure is not None:
-                        raise
-                if ipv4_res is not None:
-                    for res in ipv4_res:
-                        sockaddr = (inet_ntop(AF_INET, res), port)
-                        for socktype, proto in socktype_proto:
-                            result.append((AF_INET, socktype, proto, '', sockaddr))
-                if ipv6_res is not None:
-                    for res in ipv6_res[1]:
-                        sockaddr = (inet_ntop(AF_INET6, res), port, 0, 0)
-                        for socktype, proto in socktype_proto:
-                            result.append((AF_INET6, socktype, proto, '', sockaddr))
-            finally:
-                job.kill()
+                ipv4_res = resolve_ipv4(host, evdns_flags)[1]
+            except:
+                pass
+            if not ipv4_res:
+                ipv4_res = None
+                ipv6_res= resolve_ipv6(host, evdns_flags)[1]
+
+            if ipv4_res is not None:
+                for res in ipv4_res:
+                    sockaddr = (inet_ntop(AF_INET, res), port)
+                    for socktype, proto in socktype_proto:
+                        result.append((AF_INET, socktype, proto, '', sockaddr))
+            if ipv6_res is not None:
+                for res in ipv6_res:
+                    sockaddr = (inet_ntop(AF_INET6, res), port, 0, 0)
+                    for socktype, proto in socktype_proto:
+                        result.append((AF_INET6, socktype, proto, '', sockaddr))
+
         return result
         # TODO libevent2 has getaddrinfo that is probably better than the hack above; should wrap that.
 

Attachment: pgpfZR46CEpVp.pgp
Description: Digitale PGP-Unterschrift


--- End Message ---
--- Begin Message ---
Source: python-gevent
Source-Version: 0.13.6-1+nmu1

We believe that the bug you reported is fixed in the latest version of
python-gevent, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 690...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Michael Gilbert <mgilb...@debian.org> (supplier of updated python-gevent 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 12 Nov 2012 22:07:15 +0000
Source: python-gevent
Binary: python-gevent-dbg python-gevent-doc python-gevent
Architecture: source amd64 all
Version: 0.13.6-1+nmu1
Distribution: unstable
Urgency: medium
Maintainer: Örjan Persson <ora...@fobie.net>
Changed-By: Michael Gilbert <mgilb...@debian.org>
Description: 
 python-gevent - gevent is a coroutine-based Python networking library
 python-gevent-dbg - gevent is a coroutine-based Python networking library - 
debugging
 python-gevent-doc - gevent is a coroutine-based Python networking library - 
documenta
Closes: 690851
Changes: 
 python-gevent (0.13.6-1+nmu1) unstable; urgency=medium
 .
   * Non-maintainer upload.
   * Fix IPV6 DNS handling (closes: #690851)
     - Patch thanks to Mike Gabriel.
Checksums-Sha1: 
 30ca5a076431288908b99065a4e135b4c0c89ac0 2752 python-gevent_0.13.6-1+nmu1.dsc
 8cad94cca3d3870139c42269ba32874c37d09d79 5661 
python-gevent_0.13.6-1+nmu1.debian.tar.gz
 473e997e1f25a94758a62ee2873f2c3f5ce2e6fb 320060 
python-gevent-dbg_0.13.6-1+nmu1_amd64.deb
 0a59ba0fad42cb20ee5025fc830101ac2110f88a 138040 
python-gevent-doc_0.13.6-1+nmu1_all.deb
 e8434087991220452638d6a00f2345448d94fb10 232704 
python-gevent_0.13.6-1+nmu1_amd64.deb
Checksums-Sha256: 
 f4556d7022137bbfa725db5e2d947bd3594d59226a3cdcafd29ef8f3d748dedc 2752 
python-gevent_0.13.6-1+nmu1.dsc
 6989bb1ba3aecc41a8589176743e1b2eab4598b66e9da7f6ea1dc94ce92dc9c2 5661 
python-gevent_0.13.6-1+nmu1.debian.tar.gz
 5e659edaa6a9909b6b0f532bc740ee05b6fd7b42c68ada002ac657f1c5cd89e9 320060 
python-gevent-dbg_0.13.6-1+nmu1_amd64.deb
 b18a54b3d53c0758da9cab2f25f810acd6d1c85e6b71759e2c90978b23c23e50 138040 
python-gevent-doc_0.13.6-1+nmu1_all.deb
 2ec478948c825e44518af76487df75c1e81a2af5b311ca94a24fb51432137942 232704 
python-gevent_0.13.6-1+nmu1_amd64.deb
Files: 
 41e391a534f4d2e15553317aead76507 2752 python extra 
python-gevent_0.13.6-1+nmu1.dsc
 837094c65bca798b7b1d98e6ecbb92c1 5661 python extra 
python-gevent_0.13.6-1+nmu1.debian.tar.gz
 0a22de76c61efc1177463512d0a3f78f 320060 debug extra 
python-gevent-dbg_0.13.6-1+nmu1_amd64.deb
 23d9792fc4d9c2be7eb183d33665f435 138040 doc optional 
python-gevent-doc_0.13.6-1+nmu1_all.deb
 cd4f81d5638ba94a1fccee41e21fe361 232704 python extra 
python-gevent_0.13.6-1+nmu1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQQcBAEBCAAGBQJQoXOlAAoJELjWss0C1vRzGCQf/jXat3upNuT1pWOcHMTnmkwM
g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