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
{{ message }}
Repository navigation
Flaky tests: coroutine 'InProc.write' was never awaited #6551
Flaky test_run_spec #6549 (this one is interesting because it's with a TCP comm, which indicates the problem isn't with InProc but rather with comm handling)
Would that be resolved just by switching to asyncio? I don't actually see what's causing it to not be awaited. Is it if the _background_send coroutine gets cancelled while it's awaiting self.comm.write? AFAIU _background_send actually can't be cancelled since we don't have a handle on it.
Would that be resolved just by switching to asyncio
no it's switching to await that fixes it here - because it moves the yield point after the Coroutine has been awaited
Is it if the _background_send coroutine gets cancelled while it's awaiting self.comm.write
No the issue is the generator getting garbage collected and raising the GeneratorExit out of the yield here rather than the Future that write goes on to yield from
@graingert and I will write up a ticket or comment on what approach we're going to take here. Refactoring BatchedSend to use asyncio right now may not help/be hard, because we don't have something to hang the long-lived task off of yet. We'll probably just ignore the warning for now.
Activity
graingert commentedon Jun 21, 2022
maybe this? python/cpython#31003
graingert commentedon Jun 21, 2022
ah no it's this
distributed/distributed/batched.py
Lines 94 to 96 in 96c13a5
fjetter commentedon Jun 21, 2022
xref #6389
gjoseph92 commentedon Jun 21, 2022
Would that be resolved just by switching to asyncio? I don't actually see what's causing it to not be awaited. Is it if the
_background_sendcoroutine gets cancelled while it's awaitingself.comm.write? AFAIU_background_sendactually can't be cancelled since we don't have a handle on it.graingert commentedon Jun 21, 2022
no it's switching to
awaitthat fixes it here - because it moves the yield point after the Coroutine has been awaitedNo the issue is the generator getting garbage collected and raising the GeneratorExit out of the yield here rather than the Future that write goes on to
yield fromgjoseph92 commentedon Jun 21, 2022
Ah, so just switching to
asyncinstead of@gen.coroutine.fjetter commentedon Jun 22, 2022
Is there any known issue that would stop us from switching it?
hendrikmakait commentedon Jul 28, 2022
XREF: #6389
gjoseph92 commentedon Aug 5, 2022
@graingert and I will write up a ticket or comment on what approach we're going to take here. Refactoring BatchedSend to use asyncio right now may not help/be hard, because we don't have something to hang the long-lived task off of yet. We'll probably just ignore the warning for now.