Skip to content

Create the extension socket directory before listening - #111

Merged
ernestrc merged 3 commits into
unstablebuild:mainfrom
ejb711:create-socket-dir-before-listen
Sep 20, 2026
Merged

ernestrc merged 3 commits into
unstablebuild:mainfrom
ejb711:create-socket-dir-before-listen

Conversation

@ejb711

@ejb711 ejb711 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Part of Windows support (#68, coordinated on #81). Found by running a locally built rune.exe on
Windows 11; graphics stay with #82.

newUnixListener created <dataDir>/sockets only after bind(2) failed with ENOENT. On
Windows, AF_UNIX reports a missing parent directory as WSAENETDOWN instead, so the directory was
never created, every retry failed, and the home workspace's extensions never started. The directory
is now created before the first bind; the retry loop keeps its stale-socket handling unchanged.

Linux and macOS behave the same: the ENOENT path only ever created this directory, and
MkdirAll on an existing one is a no-op. A new test starts a listener under a data directory that
does not exist yet and checks the socket lands in <dataDir>/sockets.

Verified natively: with this, #110 and the other Windows slices applied locally, a first launch on a fresh data directory logs zero errors
and the socket file is created.

newUnixListener created <dataDir>/sockets only after bind(2) failed with ENOENT. On
Windows, AF_UNIX reports a missing parent directory as WSAENETDOWN instead, so the
directory was never created, every retry failed, and the home workspace's extensions
never started. Create the directory before the first bind; the retry loop keeps its
stale-socket handling.

Linux and macOS behave the same: the ENOENT path only ever created this directory, and
MkdirAll on an existing one is a no-op. A new test starts a listener under a data
directory that does not exist yet (unstablebuild#68).

Signed-off-by: Eric Brooks <[email protected]>
@ernestrc
ernestrc merged commit 5855bf5 into unstablebuild:main Sep 20, 2026
7 of 8 checks passed
@codecov

codecov Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/extension/extensionv2/runner.go 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

ernestrc added a commit that referenced this pull request Sep 30, 2026
Part of Windows support (#68, coordinated on #81). Found by running a
locally built `rune.exe` on Windows 11; graphics stay with #82.

The firstmover lock is a unix socket. When a leader dies 
without removing it, the next process gets an address-in-use 
error from `bind(2)` and falls back to following, then to a coup
once the dead leader stays unresponsive. That check used 
`syscall.EADDRINUSE`, which on Windows is an invented Go
errno rather than the Winsock `WSAEADDRINUSE` that bind 
returns, so the error was treated as unexpected and the service 
gave up. After any run that did not exit cleanly, every storage user
failed on the next launch: session history, window size and position,
installed packages.

Windows now also matches `WSAEADDRINUSE`, and the lock 
directory is created before the first bind, since Windows reports
a missing parent directory as `WSAENETDOWN` rather than 
`ENOENT` (same shape as #111).

Signed-off-by: Eric Brooks <[email protected]>
Signed-off-by: ernestrc <[email protected]>
Co-authored-by: ernestrc <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants