Repository navigation
Keep Node output buffers safe during worker shutdown - #278
Merged
Merged
Conversation
sidmohan0
marked this pull request as ready for review
November 18, 2026 16:39
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.
Native workspace and restore byte outputs can abort Windows Node during shutdown when external Buffer backing-store callbacks outlive their environment (nodejs/node#67417). Copy all six native byte-output paths into JavaScript-owned Buffers, preserve the public byte-array APIs, and wipe the owned export-bundle copy on success and failure.
The installed-package suite repeats its existing full fixture consumer for ten natural exits, including the worker and byte-buffer interactions that reproduced the abort. Each child has a timeout; the ten-exit regression uses no retries, forced GC, sleeps, or forced process exits. The host fixture separately proves no-op contention fails closed and that two candidates prepared from the same head can both save and release after writer contention ends; the state-changing race remains concurrent.
Two independent source reviews found no remaining external Buffer output path. Full workspace/all-features tests, formatting, full clippy with denied warnings, and all ten macOS installed-consumer exits pass; generated public types are unchanged. The final uninstrumented Windows comparison uses the same final fixture workload and all 35 copied conformance helpers for both artifacts, with matching normalized source hashes. Of 100 full consumer natural exits each, the original 8513 artifact had 92 successful exits and 8 shutdown aborts, while the copied-buffer 60a artifact had 100 successful exits and zero failures. Both complete installed setup suites also passed. The earlier comparison independently observed 9 original aborts versus zero fixed failures; production Rust source is unchanged by subsequent test-only commits.
Repeating the full suite also exposed a no-op host assertion that assumed two SQLite writers would both finish within the 250 ms busy timeout. A controlled held-writer probe demonstrates that assumption is unsupported; the original CI failure did not record its outcome and remains unclassified. A subsequent 100-pair observation passed. The corrected fixture preserves both-success/head assertions using two already-prepared candidates with serialized writes, adds an exact storage_busy/no-activation/no-release contention check, and includes outcome diagnostics for unexpected failures.