You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In fact, it did terminate the command, but the returned error was signal: killed. I don't think this is the correct error output.
What did you expect to see?
I believe it should return "context canceled,". Every developer clearly understands that the lifecycle of this command is managed by their own context, and the command would terminate due to the cancel of the context derived from their Go program.
However, "signal: killed" is an unexpected error, and it can be triggered for various reasons. This error makes the lifecycle management of the command unclear (at least to me). I'm not even sure why the command was terminated—maybe it was due to an OOM kill? Or perhaps it was manually terminated by the user? I might need to check the system logs to confirm this.
// If c.Process.Wait returned an error, prefer that.
// Otherwise, report any error from the watchCtx goroutine,
// such as a Context cancellation or a WaitDelay overrun.
iferr==nil&&watch.err!=nil {
err=watch.err
}
}
From the comments, I understand this is an expected error handling behavior. Should we revisit this behavior based on the points above for further discussion?
The text was updated successfully, but these errors were encountered:
I believe the current setup is appropriate, a timeout masks any more detailed error, and it may be that the process chooses to handle the termination signal gracefully so the error isn't always a plain killed.
Go version
go version go1.23.0 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I ran the following test code, expecting it to terminate the command as intended
What did you see happen?
In fact, it did terminate the command, but the returned error was
signal: killed.
I don't think this is the correct error output.What did you expect to see?
I believe it should return "context canceled,". Every developer clearly understands that the lifecycle of this command is managed by their own context, and the command would terminate due to the cancel of the context derived from their Go program.
However, "signal: killed" is an unexpected error, and it can be triggered for various reasons. This error makes the lifecycle management of the command unclear (at least to me). I'm not even sure why the command was terminated—maybe it was due to an OOM kill? Or perhaps it was manually terminated by the user? I might need to check the system logs to confirm this.
The relevant code can be found at
go/src/os/exec/exec.go
Lines 928 to 939 in 7c72dc7
From the comments, I understand this is an expected error handling behavior. Should we revisit this behavior based on the points above for further discussion?
The text was updated successfully, but these errors were encountered: