Fix UDS graceful restart for unix-dgram numeric errcodes - #323
Merged
bdeitte merged 1 commit intoJul 18, 2026
Merged
Conversation
unix-dgram sets err.code to a negative errno (e.g. -107), so the string-only UDS_ERROR_CODES check from bdeitte#302 never matched and sockets were never replaced after Agent UDS inode churn. Co-authored-by: Cursor <cursoragent@cursor.com>
Owner
|
Thanks- I see as well now this is broken and this looks like a good fix for me. I'm going to make a few additions here on top of this you'll see here shortly, but this is good to merge. Thanks again! |
This was referenced Jul 18, 2026
Contributor
Author
|
Awesome, thanks @bdeitte! |
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.
Summary
udsGracefulErrorHandlingnever recreates the socket on hot-shots ≥14 when usingunix-dgram, becauseprotocolErrorHandlercompareserr.codeagainst string codes only ('ENOTCONN', …), whileunix-dgramsetserr.codeto a negative numeric errno (e.g.-107/-111on Linux,-39/-54on Darwin).This is the UDS follow-on to #301 / #302: the TCP string-code fix was correct for Node TCP sockets, but the same change broke UDS matching.
Fix
Minimal change in
udsErrors(): keep the existing string codes and also include the negative numeric errnos thatunix-dgramemits.Test plan
npm installnpm test— 1957 passingtest/constants.jsassertions for numeric codesRelated
Follow-up to #301 / #302 (UDS path).
Made with Cursor