Skip to content

Recover when a stale daemon pid cannot be killed - #1426

Closed
bvinc wants to merge 1 commit into
facebook:mainfrom
bvinc:recover-from-failed-daemon-kill
Closed

Recover when a stale daemon pid cannot be killed#1426
bvinc wants to merge 1 commit into
facebook:mainfrom
bvinc:recover-from-failed-daemon-kill

Conversation

@bvinc

@bvinc bvinc commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

If buckd.info names a pid we cannot kill - it was reused by a process owned by another user, say - the kill error aborted the connect before clean_daemon_dir ran. The stale buckd.info survived, so every later invocation failed the same way and the only way out was deleting the daemon dir by hand.

Report the failed kill and start a new daemon instead of aborting.

This fixes an error seen by a user where after a PID on windows was re-used, the user was stuck until deleting their ~/.buck/buckd directory.

> buck2 killall; buck2 server

  Killed buck2.exe (26140).
  Could not connect to buck2 daemon (Could not connect to daemon), killing daemon..
  Command failed: Failed to connect to buck daemon.
      Daemon process info from C:\Users\...\.buck\buckd\C\git\roblox\game-engine\v2\buckd.info:
      pid: 21076
      endpoint: tcp:62852
      version: baf6de80...
      pid present on system: yes
      Try running `buck2 kill` and your command afterwards.
      Alternatively, try running `rmdir /s /q %USERPROFILE%\.buck\buckd` and your command afterwards
  Caused by:
      0: Error connecting to the daemon, daemon stderr follows:

If buckd.info names a pid we cannot kill - it was reused by a process owned by
another user, say - the kill error aborted the connect before clean_daemon_dir
ran. The stale buckd.info survived, so every later invocation failed the same
way and the only way out was deleting the daemon dir by hand.

Report the failed kill and start a new daemon instead of aborting.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 29, 2026
@meta-codesync

meta-codesync Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

This pull request has been imported. If you are a Meta employee, you can view this in D114131935. (Because this pull request was imported automatically, there will not be any future comments.)

@scottcao scottcao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync meta-codesync Bot closed this in 8094df3 Jul 30, 2026
@meta-codesync meta-codesync Bot added the Merged label Jul 30, 2026
@meta-codesync

meta-codesync Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This pull request has been merged in 8094df3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants