tractor icon indicating copy to clipboard operation
tractor copied to clipboard

`OSError: [Errno 9] Bad file descriptor` in cluster test

Open goodboy opened this issue 3 years ago • 0 comments

Due to some change in the downstream history introduced in #343.

Thanks to @guilledk who also discovered this issue in practice during dev of a client project.

Not entirely sure which commit(s) are causing it yet but the error looks as follows (pulled out from #344):

ERROR    tractor._supervise:_supervise.py:385 Nursery for ('root', '798cdc51-2c9e-4041-a162-6c4d0334feed') errored with
 + Exception Group Traceback (most recent call last):
 |   File "/home/goodboy/repos/tractor/tractor/_supervise.py", line 339, in _open_and_supervise_one_cancels_all_nursery
 |     yield anursery
 |   File "/home/goodboy/repos/tractor/tractor/_supervise.py", line 499, in open_nursery
 |     yield anursery
 |   File "/home/goodboy/repos/tractor/tractor/_clustering.py", line 58, in open_actor_cluster
 |     async with trio.open_nursery() as n:
 |   File "/home/goodboy/.virtualenvs/310tractor/lib/python3.10/site-packages/trio/_core/_run.py", line 850, in __aexit__
 |     raise combined_error_from_nursery
 | trio.NonBaseMultiError: OSError(9, 'Bad file descriptor'), OSError(9, 'Bad file descriptor'), OSError(9, 'Bad file descriptor'), OSError(9, 'Bad file descriptor')
 +-+---------------- 1 ----------------
   | Traceback (most recent call last):
   |   File "/home/goodboy/repos/tractor/tractor/_clustering.py", line 63, in _start
   |     portals[name] = await an.start_actor(
   |   File "/home/goodboy/repos/tractor/tractor/_supervise.py", line 155, in start_actor
   |     parent_addr = self._actor.accept_addr
   |   File "/home/goodboy/repos/tractor/tractor/_runtime.py", line 1175, in accept_addr
   |     return self._listeners[0].socket.getsockname()  # type: ignore
   | OSError: [Errno 9] Bad file descriptor
   +---------------- 2 ----------------
   | Traceback (most recent call last):
   |   File "/home/goodboy/repos/tractor/tractor/_clustering.py", line 63, in _start
   |     portals[name] = await an.start_actor(
   |   File "/home/goodboy/repos/tractor/tractor/_supervise.py", line 155, in start_actor
   |     parent_addr = self._actor.accept_addr
   |   File "/home/goodboy/repos/tractor/tractor/_runtime.py", line 1175, in accept_addr
   |     return self._listeners[0].socket.getsockname()  # type: ignore
   | OSError: [Errno 9] Bad file descriptor
   +---------------- 3 ----------------
   | Traceback (most recent call last):
   |   File "/home/goodboy/repos/tractor/tractor/_clustering.py", line 63, in _start
   |     portals[name] = await an.start_actor(
   |   File "/home/goodboy/repos/tractor/tractor/_supervise.py", line 155, in start_actor
   |     parent_addr = self._actor.accept_addr
   |   File "/home/goodboy/repos/tractor/tractor/_runtime.py", line 1175, in accept_addr
   |     return self._listeners[0].socket.getsockname()  # type: ignore
   | OSError: [Errno 9] Bad file descriptor
   +---------------- 4 ----------------
   | Traceback (most recent call last):
   |   File "/home/goodboy/repos/tractor/tractor/_clustering.py", line 63, in _start
   |     portals[name] = await an.start_actor(
   |   File "/home/goodboy/repos/tractor/tractor/_supervise.py", line 155, in start_actor
   |     parent_addr = self._actor.accept_addr
   |   File "/home/goodboy/repos/tractor/tractor/_runtime.py", line 1175, in accept_addr
   |     return self._listeners[0].socket.getsockname()  # type: ignore
   | OSError: [Errno 9] Bad file descriptor
   +------------------------------------

TODO:

  • [x] determine exact commit(s) which cause this issue in that history.. => commit from #347 which is now removed from #346 history. => funny enough this was the fix to a weird failure in the new test_feeds.py stuff in piker: https://github.com/pikers/piker/pull/414

  • [ ] presumably provide a different fix before landing the dev branches that need the patches which are the cause 😂

goodboy avatar Dec 12 '22 19:12 goodboy