Skip to content

Don't kill a daemon pid that is not a buck2 process - #1425

Open
bvinc wants to merge 1 commit into
facebook:mainfrom
bvinc:guard-daemon-kill-against-pid-reuse
Open

Don't kill a daemon pid that is not a buck2 process#1425
bvinc wants to merge 1 commit into
facebook:mainfrom
bvinc:guard-daemon-kill-against-pid-reuse

Conversation

@bvinc

@bvinc bvinc commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

buckd.info records a bare pid. If that daemon died without cleaning up, the OS may have reused the pid, so hard_kill_impl could terminate an unrelated process

  • including an ancestor of the client, which kills the client itself.

Check identity before killing, using the same rules killall already applies: a buck2 executable, and not an ancestor of this process. Unknown identity still kills, so callers that report the kill to the user keep today's behavior.

buckd.info records a bare pid. If that daemon died without cleaning up, the OS
may have reused the pid, so hard_kill_impl could terminate an unrelated process
- including an ancestor of the client, which kills the client itself.

Check identity before killing, using the same rules killall already applies:
a buck2 executable, and not an ancestor of this process. Unknown identity still
kills, so callers that report the kill to the user keep today's behavior.
@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 D114131032. (Because this pull request was imported automatically, there will not be any future comments.)

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant