This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_urllib2_localnet sporadic failures closing socket
Type: behavior Stage: resolved
Components: Tests Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: kristjan.jonsson, r.david.murray
Priority: normal Keywords:

Created on 2009-06-30 01:40 by r.david.murray, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (6)
msg89896 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-06-30 01:40
Gentoo linux, r73699, I'm seeing sporadic failures in
test_urllib2_localnet in the following two tests:

test_sending_headers
test_proxy_with_no_password_raises_httperror

It happens about once every other run in one or the other of those.  I
don't see any problems on 2.6-maint or py3k.

In both cases it is failing in the close.  Here is an example traceback:

test_sending_headers (test.test_urllib2_localnet.TestUrlopen) ...
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 46051)
Traceback (most recent call last):
  File "/home/rdmurray/python/trunk/Lib/SocketServer.py", line 281, in
_handle_request_noblock
    self.process_request(request, client_address)
  File "/home/rdmurray/python/trunk/Lib/SocketServer.py", line 308, in
process_request
    self.close_request(request)
  File "/home/rdmurray/python/trunk/Lib/SocketServer.py", line 448, in
close_request
    request.shutdown(socket.SHUT_WR)
  File "/home/rdmurray/python/trunk/Lib/socket.py", line 219, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 107] Transport endpoint is not connected
----------------------------------------
Exception in thread Thread-12:
Traceback (most recent call last):
  File "/home/rdmurray/python/trunk/Lib/threading.py", line 524, in
__bootstrap_inner
    self.run()
  File "/home/rdmurray/python/trunk/Lib/test/test_urllib2_localnet.py",
line 65, in run
    self.httpd.handle_request()
  File "/home/rdmurray/python/trunk/Lib/SocketServer.py", line 266, in
handle_request
    self._handle_request_noblock()
  File "/home/rdmurray/python/trunk/Lib/SocketServer.py", line 284, in
_handle_request_noblock
    self.close_request(request)
  File "/home/rdmurray/python/trunk/Lib/SocketServer.py", line 448, in
close_request
    request.shutdown(socket.SHUT_WR)
  File "/home/rdmurray/python/trunk/Lib/socket.py", line 219, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 107] Transport endpoint is not connected
msg90084 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-07-03 22:59
Clearly some platforms automatically set the shutdown state, and we need 
to catch that error.
msg90085 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-07-03 23:07
Commited revision 73819
Please test on gentoo
msg90106 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-07-04 04:57
Test passes consistently now on trunk in Gentoo.
msg90119 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2009-07-04 15:18
meged to py3k in revision 73845
msg96341 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2009-12-13 17:59
NB: this issue was caused by the issue 6267 patch.
History
Date User Action Args
2022-04-11 14:56:50adminsetgithub: 50630
2009-12-13 17:59:39r.david.murraysetstatus: open -> closed
type: security -> behavior
messages: + msg96341

resolution: fixed
stage: needs patch -> resolved
2009-07-04 15:18:49kristjan.jonssonsetmessages: + msg90119
2009-07-04 04:57:18r.david.murraysetmessages: + msg90106
2009-07-03 23:07:34kristjan.jonssonsetmessages: + msg90085
2009-07-03 22:59:59kristjan.jonssonsetnosy: + kristjan.jonsson
messages: + msg90084
2009-06-30 01:40:18r.david.murraycreate