Cancel parallel limiter waits - #3873
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6f4f90a772
ℹ️ 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".
| .AcquireParallelLimitAsync(moduleType, cancellationToken) | ||
| .ConfigureAwait(false); | ||
| using var executionTypeHandle = await _parallelLimitHandler | ||
| .AcquireExecutionTypeLimitAsync(moduleState, cancellationToken) |
There was a problem hiding this comment.
Preserve AlwaysRun modules while waiting on limiters
When StopOnFirstException cancels the worker pool, this cancellationToken is canceled for every dequeued module. An AlwaysRun module that has been dequeued but is still waiting for a custom or execution-type slot will now throw here before ModuleExecutionPipeline.SetupCancellation can apply the AlwaysRun exemption; ModuleRunner then marks it terminated, so teardown modules behind a limiter no longer run after another module fails. Use an uncanceled/module-specific token for AlwaysRun limiter waits, or move the AlwaysRun cancellation setup before these waits.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed at 0e8ea91. AlwaysRun modules now use their module-owned uncancelled token for both limiter waits, matching ModuleExecutionPipeline's cancellation exemption; ordinary modules still use engine cancellation. Added a regression test covering both limiter tokens with an already-cancelled engine token (ParallelLimitHandlerTests 4/4). Core Release build passes with 0 warnings/errors.
Code reviewSummary: this PR fixes #3792 by threading the engine's Both changes look correct and are the right fix for the underlying issue:
One architectural point worth considering as a follow-up (not a blocker):
This is a real side effect of fixing the execution-time-accounting bug, not a new correctness bug — the module never leaks the slot (it's released via Validation noted in the PR description (targeted unit tests + core build) matches what's appropriate for this change per this repo's agent build guidance. |
|
@codex review |
|
@claude review |
|
Codex Review: Didn't find any major issues. Keep it up! 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". |
Code reviewRe-reviewed after the new What changed: One architectural point worth considering (not a blocker):
A more maintainable shape: have Separately, the earlier architectural note from my previous review (constraint-blocked modules, e.g. Validation: |
|
Refreshed onto current main in 047373c after required Ubuntu CI hit the known core-test host failure (no failed-test summary; exit 2/134 after 13m04s). Local validation: ParallelLimitHandlerTests 4/4, ModuleTimeoutTests 12/12; core Release build 0 warnings/errors. |
Code reviewRe-reviewed at Previous feedback check: Codex's P1 ("Preserve AlwaysRun modules while waiting on limiters") was fixed in I also independently re-derived the core fix and it's sound:
Both architectural follow-ups from my previous review are still open and still non-blocking, since the code hasn't changed:
Neither blocks this PR — they're pre-existing shapes this fix inherits rather than regressions it introduces, and the module never leaks a slot ( Test coverage: the new Validation reported (local |
Closes #3792
Summary
Validation