Control: tags -1 confirmed ipv6 patch
Control: reassign -1 python3-tornado
Control: retitle -1 python3-tornado: hardcodes ipv4 binding in testing.py
Control: affects -1 src:intake

Hello,

Étienne Mollier, on 2021-10-23:
> Adrian Bunk, on 2021-10-23:
> > Note that while the IPV6-only nature of x86-conova-01 is the most likely 
> > explanation
> > why it only fails there, it is not 100% confirmed that this is the problem.
> 
> Thanks for that data point, it would explain why I failed to
> reproduce this issue on my end.  Also this:
> > ---------------------------- Captured stderr setup 
> > -----------------------------
> > 127.0.0.1 - - [16/Oct/2021 16:33:00] "GET / HTTP/1.1" 200 -
> is suspiciously close to be bound to fail on ipv6 only hosts.

After setting up an ipv6 only build machine and some head
scratching, I could consistenly reproduce the test failure.
I traced the root cause of the issue into the python3-tornado
package, which hardcodes ipv4 settings for the test environment
in a couple of locations:

        $ grep -C3 '127\.0\.0\.1' 
/usr/lib/python3/dist-packages/tornado/testing.py
            Returns a tuple (socket, port).
        
            .. versionchanged:: 4.4
               Always binds to ``127.0.0.1`` without resolving the name
               ``localhost``.
            """
            sock = netutil.bind_sockets(
                0, "127.0.0.1", family=socket.AF_INET, reuse_port=reuse_port
            )[0]
            port = sock.getsockname()[1]
            return sock, port
        --
        
            def get_url(self, path: str) -> str:
                """Returns an absolute url for the given path on the test 
server."""
                return "%s://127.0.0.1:%s%s" % (self.get_protocol(), 
self.get_http_port(), path)
        
            def tearDown(self) -> None:
                self.http_server.stop()

If I replace the occurrences of 127.0.0.1 by localhost, and ask
for unspecified socket family using AF_UNSPEC like below, then
the test suite goes back to working conditions on my ipv6 only
host (hence the patch tag):

            sock = netutil.bind_sockets(
                0, "localhost", family=socket.AF_UNSPEC, reuse_port=reuse_port
            )[0]
        --
            def get_url(self, path: str) -> str:
                """Returns an absolute url for the given path on the test 
server."""
                return "%s://localhost:%s%s" % (self.get_protocol(), 
self.get_http_port(), path)

I don't believe I can do much on intake side to improve the
situation, past cleaning up the few occurrences of ipv4
addresses in d/rules; the http_proxy definitions seem unused
anyway.  Other packages may be affected by this issue.

Kind Regards,
-- 
Étienne Mollier <emoll...@emlwks999.eu>
Fingerprint:  8f91 b227 c7d6 f2b1 948c  8236 793c f67e 8f0d 11da
Sent from /dev/pts/6, please excuse my verbosity.

Attachment: signature.asc
Description: PGP signature

Reply via email to