You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The _start_task coroutine may still be awaiting the semaphore for enough room, while a cancel was already issued for the group it is assigned to or the entire pool. Cancellation right now only affects tasks in the _tasks_running dictionary. This means the _start_task call may still spawn a new task and add it to _tasks_runningafter it was supposedly cancelled.
The text was updated successfully, but these errors were encountered:
Right now the
_start_task
method may be subject to a context switch, if the pool size is limited and there is no room for the new task at this point:asyncio-taskpool/src/asyncio_taskpool/pool.py
Line 395 in 27eb3bf
Since the
_start_task
coroutine is itself scheduled in a task fromTaskPool.apply
,TaskPool._map
, andSimpleTaskPool.start
(by proxy ofTaskPool._apply_spawner
,TaskPool._arg_consumer
, andSimpleTaskPool._start_num
respectively), this can introduce a race condition:The
_start_task
coroutine may still be awaiting the semaphore for enough room, while acancel
was already issued for the group it is assigned to or the entire pool. Cancellation right now only affects tasks in the_tasks_running
dictionary. This means the_start_task
call may still spawn a new task and add it to_tasks_running
after it was supposedly cancelled.The text was updated successfully, but these errors were encountered: