Repository navigation
fix(process): keep native cleanup pending after resource failure - #177526
Merged
Merged
Conversation
A resource failure may arrive over parent IPC after the worker socket has already observed it and finished native cleanup. Do not reject the parent's pending close with that delayed failure; keep reporting the original error and wait for the independent close receipt or actual cleanup failure. Add a deterministic delayed-failure regression with retained custody and close/release assertions. This preserves the separate execution and native settlement contract from #160946 and #173154. Validation: regression red on the old owner; 30 focused cases pass under Node and Bun with one worker. Targeted types, lint, format and P2 review pass.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review endedClawSweeper stopped reviewing this revision because the pull request closed. |
Contributor
Codex Review SummaryThis 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. |
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Oct 20, 2026
…nclaw#177526) A resource failure may arrive over parent IPC after the worker socket has already observed it and finished native cleanup. Do not reject the parent's pending close with that delayed failure; keep reporting the original error and wait for the independent close receipt or actual cleanup failure. Add a deterministic delayed-failure regression with retained custody and close/release assertions. This preserves the separate execution and native settlement contract from openclaw#160946 and openclaw#173154. Validation: regression red on the old owner; 30 focused cases pass under Node and Bun with one worker. Targeted types, lint, format and P2 review pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
A native resource import can fail and close over the worker socket before the parent IPC channel has delivered the same failure. If the parent has started awaiting cleanup in the meantime,
resource-failedrejects that pending close with the original import error, even though the broker can still confirm native closure. This intermittently failsresource-transport.test.tsin hourly 39286736487 and can misreport cleanup to real snapshot/resource callers.Keep failure reporting and native cleanup settlement independent in the existing
BrokerResourceClaimsowner. A resource failure still reaches the original error callback; only the native close receipt, explicit close error, or broker transport failure settles cleanup. No protocol, configuration, schema, dependency, or timeout changes.This is a latent ordering bug in the branch introduced by #160946 (
9c93bc347cec). #173154's documented contract says “Execution completion and physical resource closure are now settled independently.” The regression models the lagging parent IPC sequence through the real claims API and requires the original error, retained custody, and successful close/release.Evidence
original resource import failurebefore its native close receipt. Seven existing owner cases pass. Fixed regression passes.--maxWorkers=1. These are the same 30 cases on two runtimes. The owner regression itself takes under 1 ms; its eight-case owner file took 869 ms on the red baseline. CI seconds are not yet available.git diff --checkpass.Production delta: one comment updated and two incorrect cleanup-settlement lines removed. Test delta: one 36-line case using the existing fixture. The unrelated process-census mock-export red is already fixed on main by
cc942bc04e1c; this PR does not duplicate it.