Restore Windows exit delay and setBlocking workarounds#138
Closed
silverwind wants to merge 3 commits into
Closed
Conversation
Aborting the prewarms isn't enough — the keep-alive socket pool still has idle handles that race during natural shutdown on Windows + Node 24 (nodejs/node#56645). Closing the global dispatcher drains the pool cleanly, eliminating the race. Node exposes the global dispatcher via Symbol.for("undici.globalDispatcher.1"); this is the same mechanism undici itself uses to share it with the runtime. Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Owner
Author
|
Switching to a simpler workaround approach — see follow-up. |
The Symbol-based dispatcher.close workaround relied on a private Node API and didn't reliably fix the Node 24 Windows flake. Restoring the straightforward 100ms-on-Windows delay and the stdio setBlocking workaround is honest about the upstream Node bug and avoids reaching into internals. Refs nodejs/node#56645 Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Refs nodejs/node#56645 Co-Authored-By: Claude (Opus 4.7) <noreply@anthropic.com>
Owner
Author
|
Reverted #137 on master instead. See nodejs/node#56645 — this can only be fixed in Node itself. |
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.
The Symbol-based
dispatcher.close()approach relied on a private Node API and didn't reliably fix the Node 24 Windows flake. Going back to the straightforward 200ms-on-Windows delay (up from the original 50ms — community minimum is 100ms+, doubled for headroom) and the stdiosetBlockingworkaround — honest about the upstream Node bug, no reaching into internals.Refs nodejs/node#56645
This PR was written with the help of Claude Opus 4.7