bt.test_bundle.TestReadMergeableFromUrl.test_smart_server_connection_reset fails on windows

Bug #581311 reported by Martin Packman
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Medium
John A Meinel

Bug Description

Test is hoping to get a nice wrapped bzrlib.errors.ConnectionReset thrown if the server drops, but a plain WSAECONNABORTED socket.error is thrown on windows:

Traceback (most recent call last):
  File ".\bzrlib\tests\test_bundle.py", line 1847, in test_smart_server_connection_reset
    self.assertRaises(errors.ConnectionReset, read_mergeable_from_url, url)
  File ".\bzrlib\tests\__init__.py", line 1250, in assertRaises
    callableObj(*args, **kwargs)
  File ".\bzrlib\bundle\__init__.py", line 52, in read_mergeable_from_url
    _do_directive)
  File ".\bzrlib\bundle\__init__.py", line 70, in read_mergeable_from_transport
    redirected_transport)
  File ".\bzrlib\transport\__init__.py", line 1660, in do_catching_redirections
    return action(transport)
  File ".\bzrlib\bundle\__init__.py", line 58, in get_bundle
    return StringIO(transport.get_bytes(filename)), transport
  File ".\bzrlib\transport\remote.py", line 226, in get_bytes
    resp, response_handler = self._client.call_expecting_body('get', remote)
  File ".\bzrlib\smart\client.py", line 144, in call_expecting_body
    return self._call_and_read_response(
  File ".\bzrlib\smart\client.py", line 92, in _call_and_read_response
    response_tuple = response_handler.read_response_tuple(
  File ".\bzrlib\smart\message.py", line 299, in read_response_tuple
    self._wait_for_response_args()
  File ".\bzrlib\smart\message.py", line 264, in _wait_for_response_args
    self._read_more()
  File ".\bzrlib\smart\message.py", line 277, in _read_more
    bytes = self._medium_request.read_bytes(next_read_size)
  File ".\bzrlib\smart\medium.py", line 462, in read_bytes
    return self._read_bytes(count)
  File ".\bzrlib\smart\medium.py", line 474, in _read_bytes
    return self._medium.read_bytes(count)
  File ".\bzrlib\smart\medium.py", line 149, in read_bytes
    return self._read_bytes(bytes_to_read)
  File ".\bzrlib\smart\medium.py", line 903, in _read_bytes
    return osutils.read_bytes_from_socket(
  File ".\bzrlib\osutils.py", line 1997, in read_bytes_from_socket
    bytes = sock.recv(max_read_size)
error: (10053, 'Software caused connection abort')

Fails locally in a similar manner even at r3707 when it was first merged.

Failure report on babune:
<http://babune.ladeuil.net:24842/job/selftest-windows/58/testReport/junit/bzrlib.tests.test_bundle/TestReadMergeableFromUrl/test_smart_server_connection_reset/>

There is also a similar random failure on babune that may or may not be fixable at the same time:
<http://babune.ladeuil.net:24842/job/selftest-windows/59/testReport/junit/bzrlib.tests.per_branch.test_branch/ChrootedTests/test_open_containing_BzrBranchFormat8_/>

Tags: babune

Related branches

Revision history for this message
Martin Packman (gz) wrote :

Am uncertain as to whether this is a problem with the tests or with the code. Currently *CONNRESET is being caught in osutils.read_bytes_from_socket and translated to EOF, but *CONNABORTED is not.

This gist from the documentation seems to be that 'reset' is for a remote disconnect, and 'aborted' as a local disconnect:
http://www.sockets.com/err_lst1.htm#WSAECONNRESET
http://www.sockets.com/err_lst1.htm#WSAECONNABORTED
http://msdn.microsoft.com/library/ms740668#winsock.wsaeconnaborted_2

As the _DisconnectingTCPServer class used in the test is being run in the same process in a separate thread, winsock using 'aborted' seems reasonable, but not sure if it should be treated the same as 'reset' in the general case.

Andrew Bennetts (spiv)
Changed in bzr:
importance: Undecided → Medium
status: New → Confirmed
John A Meinel (jameinel)
Changed in bzr:
status: Confirmed → Fix Released
milestone: none → 2.3b5
assignee: nobody → John A Meinel (jameinel)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.