Skip to content

Let async hosts waiting on their block receive its interruption - #1506

Merged
mgomes merged 4 commits into
masterfrom
yori/vibe-238
Dec 4, 2026
Merged

mgomes merged 4 commits into
masterfrom
yori/vibe-238

Conversation

@mgomes

@mgomes mgomes commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

VIBE-238. worker_async_hosts_cannot_resume_blocks_after_catching_their_panics failed now and then, on shannon and on macOS CI (VIBE-224), with script worker failed: nested host panic instead 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.

  • The new regression test holds the block's worker past the watch's next look. It failed all 150 runs on master and passes every time with the fix.
  • With 32 concurrent copies loading shannon, the original test failed 50 of 640 runs on master and 0 of 640 with the fix. Master's failures covered every worker-lane leaf (async, construct, sync, sync_method) and every prior, not only the reported label.
  • an_asynchronous_callback_cannot_swallow_an_internal_block_error had been loosened in 886a612 to tolerate this race; it requires the callback to see the error again.

Yori added 3 commits December 3, 2026 18:16
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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T00:37:30.840749Z bd5b5b5 Manual request
🔒 Security Review ✅ Completed 2026-12-03T23:38:09.060208Z 90f4f5f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@mgomes

mgomes commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: 90f4f5f831

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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.
@mgomes

mgomes commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: bd5b5b5b2f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

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".

@mgomes
mgomes merged commit 974db12 into master Dec 4, 2026
12 checks passed
@mgomes
mgomes deleted the yori/vibe-238 branch December 4, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant