Repository navigation
Let async hosts waiting on their block receive its interruption - #1506
Conversation
The watch that interrupts async host futures fired as soon as the
invocation was cancelled or latched an error, even while the host was
only waiting on its own block. A block runs under the same limits and
returns the interruption itself, so dropping the host first only lost the
block's result. When the block had panicked, recovery then rethrew the
panic past the host that would have caught it, and the call failed as a
host error ("script worker failed: nested host panic") instead of with
the latched kind. The block's own panic latches an internal error, so
the race was open on every caught nested panic.
The watch now stands aside while the host's latest poll left it waiting
on a live block call; it interrupts the host at its next look once the
host waits on anything else.
The callback was allowed to be retired before it saw the error, because the watch could drop it while it waited on its block. That race is gone, so check what the callback observed again on every run.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
The test assumed a block of `7` is still pending at the host's first poll. On a slow runner the block's worker finished first, so the first poll returned the result and the host's assertion failed. The block now calls an async host that ends only on cancellation.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
VIBE-238.
worker_async_hosts_cannot_resume_blocks_after_catching_their_panicsfailed now and then, on shannon and on macOS CI (VIBE-224), withscript worker failed: nested host panicinstead of the latched error kind.The test was right; the engine had a race. The watch that interrupts async host futures looks every 5 ms for cancellation, a passed deadline or a latched error, and drops the host's future when it finds one. It did that even when the host was only waiting on its own block. That block runs under the same limits and returns the interruption itself, so dropping the host first only lost the block's result. When the block had panicked, recovery rethrew the panic past the host that would have caught it, and the whole call failed as a host error. A caught nested panic latches an internal error on the block's worker before the block finishes, so any slow moment between the two was enough.
The watch now leaves a host alone while its latest poll left it waiting on a live block call. Once the host waits on anything else, the watch's next look interrupts it. Recovery already had to wait for the block, so a call takes no longer to end; the host just sees what the block returned.
an_asynchronous_callback_cannot_swallow_an_internal_block_errorhad been loosened in 886a612 to tolerate this race; it requires the callback to see the error again.