Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

os: incompatible change to os.FindProcess Pid field #67640

Closed
prattmic opened this issue May 24, 2024 · 1 comment
Closed

os: incompatible change to os.FindProcess Pid field #67640

prattmic opened this issue May 24, 2024 · 1 comment
Assignees
Milestone

Comments

@prattmic
Copy link
Member

As of https://go.dev/cl/570036, FindProcess on a process that doesn't exist returns a Process with Pid == -2, which serves as a sentinel value that Wait and Signal should unconditionally return ErrProcessDone.

However this could break programs that export Pid to equal the value they pass to FindProcess, so I would consider this an incompatible change. That said, I am not aware of real programs broken by this.

My work-in-progress fix for #67634 adds additional internal state to Process for tracking handle validity. It would be easy to track "already done" state there as well, so we may as well fix this incompatibility.

cc @kolyshkin

@prattmic prattmic added this to the Go1.23 milestone May 24, 2024
@prattmic prattmic self-assigned this May 24, 2024
@gopherbot
Copy link
Contributor

Change https://go.dev/cl/588675 mentions this issue: os: overhaul handling of PID vs pidfd within Process

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants