Skip to content

Commit

Permalink
Workaround for aiorun triggering stackoverflow in Python (#88)
Browse files Browse the repository at this point in the history
Under certain circumstances this line in `aiorun` can trigger the following
Python bug python/cpython#93837

The program will crash with a stack overflow error, probably because the
call to log the task about the be cancelled will call repr on a task that
references itself somehow.
  • Loading branch information
StefanD986 authored May 8, 2024
1 parent 6023e9c commit 5130d38
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion aiorun.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,6 @@ async def new_coro():
# TODO: we don't need access to the coro. We could simply
# TODO: store the task itself in the weakset.
if t._coro not in _DO_NOT_CANCEL_COROS:
logger.debug("Cancelling task: %s", t)
t.cancel()

async def wait_for_cancelled_tasks(timeout):
Expand Down

0 comments on commit 5130d38

Please sign in to comment.