Skip to content

fix: an exiting daemon removes only its own socket (0.3.5) - #22

Merged
AbirAbbas merged 2 commits into
mainfrom
fix/own-socket-only
Oct 27, 2026
Merged

AbirAbbas merged 2 commits into
mainfrom
fix/own-socket-only

Conversation

@AbirAbbas

Copy link
Copy Markdown
Contributor

What was wrong

A furrow serve daemon that outlived its client removed its socket path when it idled out, even if a newer daemon had since bound that same path. Afterwards the newer daemon kept listening and kept holding the lock, but no client could reach it: every dial failed with no such file or directory, and a freshly started daemon found the lock held and exited at once. codeaf hit this in a two-computer test (Agent-Field/CodeAF#1982).

What changed

  • The server records the Unix socket's device and inode when it binds. At shutdown it removes the path only while it still names that socket, reading the entry without following symlinks. Idle, signalled and requested shutdowns all use this check.
  • Windows cleanup and lock handling are unchanged.
  • Release 0.3.5: a version bump only, the same edits as 0.3.4.

Tests

furrow-daemon/tests/socket_cleanup.rs (Unix only):

  • an older daemon exiting after a newer one bound the same path leaves the newer socket and its lock in place;
  • a replacement plain file or symlink survives;
  • a missing path is fine;
  • an untouched socket is still removed on exit, as before.

Three of these failed before the fix.

🤖 Generated with Claude Code

AbirAbbas and others added 2 commits October 26, 2026 21:15
Record the Unix socket's device and inode when it is bound, and at shutdown
remove the path only while it still names that socket. A daemon that outlived
its client used to unlink the socket a newer daemon had bound at the same path,
which left the newer one listening, holding the lock, and unreachable. Idle,
signalled and requested shutdowns all go through the same check; Windows is
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@AbirAbbas
AbirAbbas merged commit 10bcb1e into main Oct 27, 2026
3 of 4 checks passed
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