[issue11812] transient socket failure to connect to 'localhost'
Jesús Cea Avión
report at bugs.python.org
Tue Nov 8 12:47:48 CET 2011
Jesús Cea Avión <jcea at jcea.es> added the comment:
The only way for the server thread being around would be if the test fails badly, not calling teardown (I would do a fake tcp connection to the server in the teardown, followed by a thread.join). In this case, the thread (being "daemon") will die when the tests are done anyway, and the test will be showed as fail in the buildbots, so somebody should take care of it. I would not mask anything.
About using getsockname(), the bind would bind to all IPs of the machine, including real network interfaces. I rather prefer to keep the bind private and not accesible from the external network :-).
I really think that ipv6-only hosts are a non-issue just now. And the failure would be quite self-evident. In Solaris I get this exception: "socket.error: [Errno 126] Cannot assign requested address". Quite clear.
Anyway, we can keep using "localhost", but just delete the socket timeout in the server.
About the nameresolution speed, it is actually happening. Could be, too, a busy machine. I know that some buildbots are running inside a virtual machine, sometimes with little real RAM and possibly paging a lot. The fact is that the 3 second delay is actually happening, and I don't think that solution should be to increase the timeout. That only mask the issue.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list