Repository navigation
fix(artifacts): preserve iNES shutdown ownership and I/O failures - #10554
ShuaixinHuang wants to merge 5 commits into
Conversation
Codex Review Summary: ❌ FailedThis 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 usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The reviewed changes appear safe to merge; no blocking defect was found. SummaryThe PR makes iNES readers wait for admitted reads, stream retirement, and final source checks before releasing an owned descriptor.
The review used the full PR changes because the current and previous review commits have different merge bases with the supplied target commit. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Reader admits work] --> B[Read region bytes]
B --> C[Check byte count and source]
D[Caller closes reader] --> E[Stop region producers]
E --> F[Wait for admitted work and stream retirement]
C --> F
F --> G{Reader owns descriptor?}
G -->|No| H[Leave descriptor with caller]
G -->|Yes| I[Close owned descriptor]
I -->|Close fails| J[Retain reader for retry]
Reviews (5) · Last reviewed commit: "fix(ci): sync accepted main fixes for PR..." · Reviewed by Greptile |
|
@morluto Could you please review this iNES lifecycle and I/O-failure fix? Author readiness is complete. The regressions reproduce 17 failures on the unchanged tested base ( |
Problem and fix
Closing an iNES reader during a region read or final identity check could release an extraction-owned descriptor before admitted work retired. Buffered streams and paused inventories could continue after closure. A shared descriptor-read race could also replace a physical I/O failure with cancellation while forwarding its rejected read.
Use the existing artifact resource scope to admit work, stop producers, and join producer completion plus readable retirement. Admit final identity validation independently; borrowed descriptors stay with their admitting owner, and failed owned closes retain their retry owner. The descriptor reader keeps a failed-read state until the physical failure is forwarded. Post-await checks prevent allocating streams after closure or cancellation.
The doctor cancellation fixture publishes a complete readiness record by rename, after installing its SIGTERM handler. This preserves strict PID/run-token, exit-status, and cleanup assertions.
Current-main alignment
Normally merged latest main
2237f936f0059ccba1d02afb0f1ba134d375ed62into this same PR, headecadb018a065a6b171dc8526410cce752a279d9e. This follow-up merge was conflict-free and retains the six-file final diff. The earlier reader conflict resolution preserves both the lifecycle scope and main's traversal coverage callback; the doctor fixture retains handler-before-readiness ordering. Main's accepted Kuna child-exit ordering and fake-Hopper contract repair (#10734) are included unchanged, with no competing patch.Fresh final-tree qualification reran the exact five-suite selection below: 108 passed, no skips, exit 0, under the local-only subreaper (six adopted children reaped).
npm run check:fastpassed with both tasks executed; normal commit/pre-push hooks and final diff checks passed. New-head hosted CI is pending. The historical hosted and initial local failures below remain evidence for their executed revisions, not failures or successes of this new head.Reproduction and validation
Historical original-fix evidence, on unchanged
8578daf8bproduction with the regression files: 17 failed / 78 passed, plus one uncaught cancellation error. Restoring the production files and applying the fix produced 15 suites / 353 passed, including compiled CLI/stdio MCP and sibling artifact consumers. These are historical results, not current-head executions.Current final tree, Linux x64, Node 24.22.1, npm 11.16.0:
npm run test:focused -- tests/boundary/filesystem/inesArtifact.test.ts tests/boundary/filesystem/inesCancellation.test.ts tests/boundary/filesystem/fileHandleChunks.test.ts tests/boundary/cli/doctorCancellation.test.ts tests/boundary/providers/kuna/kunaVersionProbeOwnership.test.ts: 5 suites / 108 passed, no skips, exit 0. Executed through a local-only Linux subreaper wrapper that reaps this command's adopted child processes; it is not repository code and changes no test assertion, deadline, or selection.npm run check:fast: passed. Normal commit and pre-push hooks and final diff checks passed.No fresh complete monolithic check, native Windows/macOS, real Hopper application, or emulator execution is claimed. Hosted CI at this new head is pending; local fixture passes do not establish real-provider behavior or hosted success.
History
Replaces #10152 at the author's request; that closed PR preserves the original review and CI history. Its two actionable automated findings remain included here. This update preserves the existing initial human readiness declaration without claiming a new human review of the follow-up.
Author readiness
Human owner: @ShuaixinHuang
The human owner explicitly confirmed review of this replacement’s final diff and current-base evidence on 2026-11-14 for head
4f6d85635b5cc8236fcf2ba54a835d72623f5c98, and declared it ready for initial maintainer review.