multi: add timeout to reply.get - #221
Conversation
It is possible for this call to hang, like the other calls in this function. Passing through the timeout removes that possibility
RonnyPfannschmidt
left a comment
There was a problem hiding this comment.
This looks a bit like each action is getting 2 spawns (one outer,one inner)
The invocation nesting Looks incorrect
|
@JCourt1 do you have a example of the hang? the code in question should pass in all cases for threading, is there a different execmodel involved (the killfunc has a own timeout that should apply) |
Yes I agree with you in principle, I was confused by this. I can say though that empirically I am hitting the issue... Unfortunately I'm not able to reproduce this in a minimal example outside of the codebase I am encountering it in. It's through pytest-xdist, and I think that does just use "thread" as the execmodel. I just hit it again actually: re. this:
I get the impression that it is that way just to allow the |
|
I believe the intent was to complete all Tasks from the pool Its unclear what's is needed for the other backends |
|
Superseded by #419 — hardens the timeout handling (so a stuck kill cannot raise/ |
|
thanks for providing this initial version it helped me do the complete fix in #419 |
safe_terminate had no caller in src/ since termination moved into AsyncGroup._terminate_one -- only the deprecated-name map and three tests, so the pytest-dev#43/pytest-dev#221 bound was being tested on a function nothing used. Removed, and the bound is now asserted on Group.terminate() against a worker that ignores SIGINT and never returns from its exec. AsyncGroup allocated ids as "gw%d" % len(self._gateways), over a list that terminate() empties -- so gw0 could name two different workers in one session, in its traces and in whatever the caller keyed on it. Also records the two findings that are not fixes: execnet.aio can drop an item when a receive is cancelled after the host already took it (the docstring promised otherwise and now says what it can), and the channel has no flow control at all -- 500 MiB lands in a non-consuming peer's memory in 0.33s with nothing pushing back. The second wants HTTP/2-shaped windows plus the reporting that makes a full window distinguishable from a hang, and a credit field is cheaper to reserve before the protocol ships. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
It is possible for this call to hang, like the other calls in this function. Passing through the timeout removes that possibility.
This was first noted on #43