Skip to content

Cancelling a task that's waiting on a closed socket -> TrioInternalError #555

@nonsleepr

Description

@nonsleepr

Using Python 3.7 on Mac with trio 0.4.0. A lot of noise on Ctrl+C:

^C
Traceback (most recent call last):
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 1229, in run
    result = run_impl(runner, async_fn, args)
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 1357, in run_impl
    runner.task_exited(task, final_result)
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 857, in task_exited
    task._parent_nursery._child_finished(task, result)
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 391, in _child_finished
    self._add_exc(result.error)
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 376, in _add_exc
    self.cancel_scope.cancel()
  File ".../lib/python3.7/site-packages/trio/_core/_ki.py", line 164, in wrapper
    return fn(*args, **kwargs)
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 149, in cancel
    task._attempt_delivery_of_any_pending_cancel()
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 558, in _attempt_delivery_of_any_pending_cancel
    self._attempt_abort(raise_cancel)
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 538, in _attempt_abort
    success = self._abort_func(raise_cancel)
  File ".../lib/python3.7/site-packages/trio/_core/_io_kqueue.py", line 106, in abort
    r = abort_func(raise_cancel)
  File ".../lib/python3.7/site-packages/trio/_core/_io_kqueue.py", line 122, in abort
    self._kqueue.control([event], 0)
FileNotFoundError: [Errno 2] No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../lib/python3.7/site-packages/trio/_core/_run.py", line 1235, in run
    ) from exc
trio.TrioInternalError: internal error in trio - please file a bug!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions