Repository navigation
fix: leave a live socket alone instead of taking over its path at startup - #431
Merged
Merged
Conversation
…rtup bindListenerSocket unlinked the socket path before binding without checking whether another app was still listening there, so a second build launched on the default path cut the running app's CLI and agent hooks off. Probe the path first and treat a live listener as EADDRINUSE, which falls back to the user-scoped path.
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.
What this does
Launching a second build of Programa (a bench, a staging copy, a build with a different bundle id) no longer knocks the running app's command line tool and agent hooks offline. The new copy used to delete the running app's socket and take it over, and the running app stayed unreachable until someone ran Restart CLI Listener.
Do not merge until the fix commit is on this PR. The first push is the failing test alone, so CI shows it catches the bug.
Summary
bindListenerSocketunlinked the socket path before binding without checking whether another app was listening there. fix: give windowless launches a window and stop them deleting another app's socket #426 stopped the same takeover on quit; this covers startup.EADDRINUSE, and an inconclusive probe (for exampleEMFILE, or a listener owned by another user) fails with its errno, so the default path falls back to the user-scoped one (programa-<uid>.sock) instead of taking the incumbent's path. The CLI resolves the default path first whenever it is live, so the fallback never redirects it.Test Plan
testStartLeavesALiveListenerFromAnotherProcessInPlacefails on the test commit and passes once the fix is pushed.ping, and the new build boundprograma-501.sock.