fix(net): preserve destroy errors when canceling in-flight writes - #70
Merged
Merged
Conversation
|
Hi! I'm the It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃 |
steipete
force-pushed
the
claude/w67-socket-destroy-write
branch
from
October 2, 2026 06:34
8d0f7fa to
d00efae
Compare
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.
A pending socket write previously received
ERR_SOCKET_CLOSEDsynchronously from the native close handler before an explicitdestroy(error)reached the stream. A forwarding Duplex could therefore finish with the generic socket error instead of the owner's cancellation reason.Ports the open upstream oven-sh/bun#43250, with credit to @robobun. Detach in-flight write callbacks before native teardown, then report Node's
write ECANCELEDafter the explicit error and before close. A guard prevents a connect-wait listener from completing an already-canceled write twice. The native socket ownership and public API remain unchanged.Validation: on AWS Linux with Node 24.21.0 as the oracle, the new matrix has 12 Node passes and 12 Bun failures before the fix. After the fix, both full net/TLS files pass (280 tests, 9 skips, zero failures; 10.37 seconds), covering TCP/TLS, client/server writes, corked batches, reset, and destroy callbacks. Built-in TypeScript checks pass. P2 Codex review is scoped-clean before commit; branch review and exact-head Linux/macOS lanes gate landing.