Repository navigation
core: sweep stale local-domain socket files on Windows (#433) - #463
Open
KonradBreitsprecherBkd wants to merge 1 commit into
Open
KonradBreitsprecherBkd wants to merge 1 commit into
KonradBreitsprecherBkd wants to merge 1 commit into
Conversation
Socket files of killed processes stayed in %TEMP% forever. Each acceptor now holds a handle on its socket file without FILE_SHARE_DELETE, so other processes can only delete it once the owner is gone. On startup, each process deletes the deletable *.silkit sockets in %TEMP%\SilKit\. Default socket files move to %TEMP%\SilKit\, so sockets of older versions are never swept. This also drops the '92' prefix from the file names. Use the non-throwing fs::remove overloads before bind and in CleanupEndpoint; a guarded file would otherwise throw. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Konrad Breitsprecher <Konrad.Breitsprecher@vector.com>
This branch has not been deployed
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.
Fixes #433.
Summary
The OS tracks whether the owner is alive. No connect probes, no grace periods, so no bind/listen race:
Linux/macOS: guard and sweep are no-ops, paths unchanged.
Also: the remove-before-bind calls and
CleanupEndpointnow use the non-throwingfs::remove, which a guarded file would otherwise make throw.Evidence
Stop-Process -Forcethe registry 5×) → 5 files left, forever.After:
Test_LocalSocketGuard(Windows only): guarded file can't be deleted but still accepts connections; sweep removes a stale socket and keeps live sockets, regular*.silkitfiles, and sockets with other extensions.Merge Danger
Door: two-way
Blast Radius: small
A participant and a registry of different versions connect over TCP instead of the local-domain socket, because both sides compute the registry's socket path independently. This already happens whenever their working directories differ (e.g., the registry running as a service). Peer-to-peer connections are unaffected: those URIs are advertised.
Not included: a configurable socket directory or Linux abstract sockets. Those can be follow-ups.
🤖 Generated with Claude Code