[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-25 Thread Taras Voinarovskyi
Taras Voinarovskyi added the comment: Hi Chris, Yes, I do believe that is the respectful change, if we look the CancelledError is not checked to be external or originate from the timer. Best regards, Taras Voinarovskyi -- ___ Python tracker

[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-23 Thread Taras Voinarovskyi
New submission from Taras Voinarovskyi : Hi, during migration to Python 3.8.6 we encountered a behavior change from previous versions: wait_for ignored the request to cancellation and returned instead. After investigation, it seems to be related to the update in bpo-32751 and is only

[issue35751] traceback.clear_frames manages to deadlock a background task

2019-01-16 Thread Taras Voinarovskyi
Taras Voinarovskyi added the comment: For now, it seems like ``copy.copy(exception)`` before raising seems to prevent this behaviour. So for all exceptions originating from background tasks I raise a copy to the user, rather than the original exception. It prints correct stack, so no real

[issue35751] traceback.clear_frames manages to deadlock a background task

2019-01-16 Thread Taras Voinarovskyi
Taras Voinarovskyi added the comment: So yes, the `clear_frames` function will force a running generator to close. See https://github.com/python/cpython/blob/3.7/Objects/frameobject.c#L566, it explicitly does a Finalize. Would that be the desired behaviour for assertRaises is not clear. I