ValueError: file descriptor cannot be a negative integer (-1)

Bug #918717 reported by Wouter van Heyst
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned

Bug Description

Running the testsuite under pypy sometimes trips up select. The amount of failures and precise tests where it happens vary from run to run.
On my work machine the test subset bzrlib.tests.per_branch is big enough to fail every time. The set bzrlib.tests.per_branch.test_branch fails a bit more than half of the times.

The traceback does seem of the same shape each time, one instance:

    ../pypy-1.7/bin/pypy ./bzr selftest -s bzrlib.tests.per_branch -1

        …

    ERROR: bzrlib.tests.per_branch.test_branch.TestBranch.test_bad_revision(RemoteBranchFormat-default)
    ----------------------------------------------------------------------
    _StringException: log: {{{
    15.996 creating repository in chroot-215537328:///abranch/.bzr/.
    16.002 creating branch <bzrlib.branch.BzrBranchFormat7 object at 0x0b7e58d0> in chroot-215537328:///abranch/
    }}}

    traceback-1: {{{
    Traceback (most recent call last):
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 698, in stop_server
        super(SmartTCPServer_for_testing, self).stop_server()
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 569, in stop_server
        self.server.stop_client_connections()
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 373, in stop_client_connections
        self.shutdown_client(c)
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 487, in shutdown_client
        connection_thread.join()
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 256, in join
        super(TestThread, self).join(timeout)
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/cethread.py", line 128, in run
        super(CatchingExceptionThread, self).run()
      File "/m/home/home01/wvanheij/unix/src/pypy-1.7/lib-python/2.7/threading.py", line 483, in run
        self.__target(*self.__args, **self.__kwargs)
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 445, in process_request_thread
        self, request, client_address)
      File "/m/home/home01/wvanheij/unix/src/pypy-1.7/lib-python/2.7/SocketServer.py", line 585, in process_request_thread
        self.handle_error(request, client_address)
      File "/m/home/home01/wvanheij/unix/src/pypy-1.7/lib-python/2.7/SocketServer.py", line 582, in process_request_thread
        self.finish_request(request, client_address)
      File "/m/home/home01/wvanheij/unix/src/pypy-1.7/lib-python/2.7/SocketServer.py", line 323, in finish_request
        self.RequestHandlerClass(request, client_address, self)
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 612, in __init__
        server)
      File "/m/home/home01/wvanheij/unix/src/pypy-1.7/lib-python/2.7/SocketServer.py", line 639, in __init__
        self.handle()
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/tests/test_server.py", line 617, in handle
        server_protocol = self._build_protocol()
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/smart/medium.py", line 279, in _build_protocol
        self._wait_for_bytes_with_timeout(self._client_timeout)
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/smart/medium.py", line 401, in _wait_for_bytes_with_timeout
        return self._wait_on_descriptor(self.socket, timeout_seconds)
      File "/m/home/home01/wvanheij/unix/src/bzr-pypy/bzrlib/smart/medium.py", line 304, in _wait_on_descriptor
        rs, _, xs = select.select([fd], [], [fd], poll_timeout)
    ValueError: file descriptor cannot be a negative integer (-1)
    }}}

In this case that already happened after running 159 tests. It does not seem
likely filedescriptors would be exhausted by then, so some sort of race
conditionn?

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.