Skip to content

Refactor stdout and stderr handling in BuckdLifecycle#1235

Open
dkranchii wants to merge 1 commit intomainfrom
fix/propagate-error-in-daemon-spawn
Open

Refactor stdout and stderr handling in BuckdLifecycle#1235
dkranchii wants to merge 1 commit intomainfrom
fix/propagate-error-in-daemon-spawn

Conversation

@dkranchii
Copy link

Summary

Simplified error handling for child process stdout and stderr by replacing unwrap() with the ? operator for better error propagation.

  • Replace .ok_or_else(|| internal_error!(...)).unwrap() with
    .ok_or_else(|| internal_error!(...))? in start_server_unix
  • The function already returns buck2_error::Result<()>, so ?
    propagates the error gracefully instead of panicking the client
  • The same function already uses ? on the line immediately above
    (cmd.spawn()?) — this change makes the error handling consistent

Test plan

  • cargo check -p buck2_client_ctx — compiles cleanly
  • cargo test -p buck2_client_ctx — all tests pass
  • Behavioral: if stdout/stderr pipes are unexpectedly missing after
    spawn, the client now returns a descriptive error instead of panicking

@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 Feb 16, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Feb 16, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D93430377. (Because this pull request was imported automatically, there will not be any future comments.)

@dkranchii dkranchii force-pushed the fix/propagate-error-in-daemon-spawn branch from 142986d to 94f6180 Compare February 16, 2026 20:45
Summary: Simplified error handling for child process stdout and stderr by replacing unwrap() with the ? operator for better error propagation.
@dkranchii dkranchii force-pushed the fix/propagate-error-in-daemon-spawn branch from 94f6180 to 3d27df2 Compare February 16, 2026 22:47
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