Repository navigation
fix(artifacts): preserve member stream failures through reader close - #12489
Conversation
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. |
[Medium impact] The reviewed changes appear safe to merge; no blocking code issue was found. SummaryThis PR shares member-stream shutdown handling across positional, uImage, Bun, and Deno readers.
No actionable new issues were found. Review conclusions are source-based; tests were not run. Supersession could not be checked because GitHub access required authentication. Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Open member] --> B[Combine caller and reader-close signals]
B --> C[Read member bytes]
C --> D[Check byte count and source identity]
C -->|Physical failure| E[Return original failure]
D -->|Physical failure| E
D -->|Checks succeed| F{Interrupted?}
F -->|Caller first| G[Return cancelled]
F -->|Close first| H[Return unavailable]
F -->|No| I[Complete stream]
E --> J[Retire stream]
G --> J
H --> J
I --> J
J --> K[Close owned descriptor after joined work]
Reviews (2) · Last reviewed commit: "fix(artifacts): retain standalone read f..." · Reviewed by Greptile |
Summary
Preserve the result of admitted member reads and final verification when an artifact reader closes. Fixes #12487. Builds on the descriptor-read ownership landed in #11748.
Problem and change
Several artifact readers destroyed member output as soon as close was requested. A pending file read or final descriptor check could later fail physically, after the consumer had already received
unavailable.Positional readers, uImage, Bun, and Deno now share member-stream shutdown handling. Close joins admitted producer and verification work. A physical failure reaches the consumer. When I/O succeeds, the first caller abort or reader close determines the result. Owned descriptors retire after joined cleanup and borrowed descriptors remain usable. Bun also checks selected-path identity at member completion, after a verified case in which same-byte replacement passed undetected.
Evidence and validation
EIOon held reads and final descriptor verification. The corrected cases preserve the exact cause, distinguish caller-first and close-first interruption, and check descriptor ownership. A paired same-byte replacement verifies Bun and Deno path identity.check:fast, formatting, and diff checks passed.Author readiness
Human owner: @morluto