Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random failure of test_TCPServer() of test.test_socketserver.SocketServerTest and test_handle_accept() of test.test_asyncore.TestAPI_UseIPv6Select on FreeBSD buildbots #71971

Closed
vstinner opened this issue Aug 17, 2016 · 5 comments
Labels
tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error

Comments

@vstinner
Copy link
Member

BPO 27784
Nosy @vstinner, @berkerpeksag, @vadmium, @koobs
Superseder
  • bpo-30319: Change socket.close() to ignore ECONNRESET
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2016-12-05.17:35:40.044>
    created_at = <Date 2016-08-17.08:23:42.030>
    labels = ['type-bug', 'tests']
    title = 'Random failure of test_TCPServer() of test.test_socketserver.SocketServerTest and test_handle_accept() of test.test_asyncore.TestAPI_UseIPv6Select on FreeBSD buildbots'
    updated_at = <Date 2017-07-04.14:56:54.571>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2017-07-04.14:56:54.571>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-12-05.17:35:40.044>
    closer = 'vstinner'
    components = ['Tests']
    creation = <Date 2016-08-17.08:23:42.030>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 27784
    keywords = []
    message_count = 5.0
    messages = ['272910', '273001', '273382', '282444', '297667']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'berker.peksag', 'martin.panter', 'koobs']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'needs patch'
    status = 'closed'
    superseder = '30319'
    type = 'behavior'
    url = 'https://bugs.python.org/issue27784'
    versions = ['Python 3.6']

    @vstinner
    Copy link
    Member Author

    http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/4760/steps/test/logs/stdio

    test_handle_accept (test.test_asyncore.TestAPI_UseIPv6Select) ... ERROR

    ======================================================================
    ERROR: test_handle_accept (test.test_asyncore.TestAPI_UseIPv6Select)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_asyncore.py", line 500, in tearDown
        asyncore.close_all()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 561, in close_all
        x.close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/asyncore.py", line 397, in close
        self.socket.close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 407, in close
        self._real_close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 401, in _real_close
        _ss.close(self)
    ConnectionResetError: [Errno 54] Connection reset by peer
    
    ----------------------------------------------------------------------
    
    
    0:15:27 [319/402/4] test_socketserver failed -- running: test_tokenize (190 sec), test_datetime (279 sec), test_tools (194 sec)
    (...)
    test_TCPServer (test.test_socketserver.SocketServerTest) ... creating server
    ADDR = ('127.0.0.1', 42875)
    CLASS = <class 'socketserver.TCPServer'>
    server running
    test client 0
    test client 1
    Exception in thread <class 'socketserver.TCPServer'> serving:
    Traceback (most recent call last):
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 916, in _bootstrap_inner
        self.run()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/threading.py", line 864, in run
        self._target(*self._args, **self._kwargs)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socketserver.py", line 238, in serve_forever
        self._handle_request_noblock()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socketserver.py", line 319, in _handle_request_noblock
        self.handle_error(request, client_address)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socketserver.py", line 317, in _handle_request_noblock
        self.process_request(request, client_address)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socketserver.py", line 349, in process_request
        self.shutdown_request(request)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socketserver.py", line 510, in shutdown_request
        self.close_request(request)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socketserver.py", line 514, in close_request
        request.close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 407, in close
        self._real_close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/socket.py", line 401, in _real_close
        _ss.close(self)
    ConnectionResetError: [Errno 54] Connection reset by peer

    ERROR
    /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/case.py:628: ResourceWarning: unclosed <socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 42877), raddr=('127.0.0.1', 42875)>
    outcome.errors.clear()
    /usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/unittest/case.py:628: ResourceWarning: unclosed <socket.socket fd=4, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 42875)>
    outcome.errors.clear()
    (...)
    ======================================================================
    ERROR: test_TCPServer (test.test_socketserver.SocketServerTest)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 175, in test_TCPServer
        self.stream_examine)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/support/__init__.py", line 1956, in decorator
        return func(*args)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 141, in run_server
        testfunc(svrcls.address_family, addr)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 153, in stream_examine
        buf = data = receive(s, 100)
      File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/test_socketserver.py", line 46, in receive
        raise RuntimeError("timed out on %r" % (sock,))
    RuntimeError: timed out on <socket.socket fd=5, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('127.0.0.1', 42877), raddr=('127.0.0.1', 42875)>

    Ran 25 tests in 25.825s

    @vadmium
    Copy link
    Member

    vadmium commented Aug 17, 2016

    I think I have seen these kind of errors pop up randomly on various tests on Free BSD buildbots (at least in the last few months or so).

    Are the buildbots so overloaded that they drop localhost connections? Or are localhost TCP connections generally just that unreliable on Free BSD? Or is something else going on? I’m not faimilar with the OS.

    This only seems to affect 3.6, not the equivalent 3.5 buildbot.

    @berkerpeksag
    Copy link
    Member

    Here is another one on koobs-freebsd10: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.x/builds/4809/steps/test/logs/stdio test_handle_accept was fine this time.

    And this one is from koobs-freebsd9:

    ======================================================================
    ERROR: test_handle_accept (test.test_asyncore.TestAPI_UseIPv6Select)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/test/test_asyncore.py", line 500, in tearDown
        asyncore.close_all()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/asyncore.py", line 561, in close_all
        x.close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/asyncore.py", line 397, in close
        self.socket.close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/socket.py", line 407, in close
        self._real_close()
      File "/usr/home/buildbot/python/3.x.koobs-freebsd9/build/Lib/socket.py", line 401, in _real_close
        _ss.close(self)
    ConnectionResetError: [Errno 54] Connection reset by peer

    http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.x/builds/4705/steps/test/logs/stdio

    @berkerpeksag berkerpeksag added tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error labels Aug 22, 2016
    @vstinner
    Copy link
    Member Author

    vstinner commented Dec 5, 2016

    I didn't look at buildbots recently, and I don't have access to FreeBSD, so I just close the issue :-/

    @vstinner vstinner closed this as completed Dec 5, 2016
    @vstinner
    Copy link
    Member Author

    vstinner commented Jul 4, 2017

    Duplicate of bpo-30319.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    tests Tests in the Lib/test dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants