-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add a check for when the command is canceled by the program on Window… #29538
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
Conversation
Could the code be simplified to this?
I think it should cover all cases.
(I haven't carefully thought about this problem at the moment, just a brief idea) |
this is hard to test , considering the context may be canceled anywhere by the parent, I can't be sure that the error always returns before the context is canceled. If not, the real error will be ignored. |
a34310f
to
078cfad
Compare
Hmm, I think it's worth to do the change. According to the "Context" document:
I think using ctx.Err() correctly would make code more correct. If you have worries about it .... I could do such "refactoring", if I am wrong I will follow it and propose related fixes. 😁 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check is pretty strict, so it could be good enough.
* upstream/main: Fix a bug returning 404 when display a single tag with no release (go-gitea#29466) Add a check for when the command is canceled by the program on Window… (go-gitea#29538) Fix incorrect redirection when creating a PR fails (go-gitea#29537) Fix incorrect subpath in links (go-gitea#29535) Fix issue link does not support quotes (go-gitea#29484) (go-gitea#29487)
Close #29509
Windows, unlike Linux, does not have signal-specified exit codes. Therefore, we should add a Windows-specific check for Windows. If we don't do this, the logs will always show a failed status, even though the command actually works correctly.
If you check the Go source code in exec_windows.go, you will see that it always returns exit code 1.

The exit code 1 does not exclusively signify a SIGNAL KILL; it can indicate any issue that occurs when a program fails.