-
Notifications
You must be signed in to change notification settings - Fork 18.1k
os/exec: Unable to kill a command on macOS? #27440
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
Comments
Is it only when you exec |
@mark-rushakoff It doesn't matter if you run it using |
For me, this happens only when running with |
If you press
If you use |
Same for me, It appears that if I keep requesting server that was supposed to be killed eventually it will exit. |
Sorry, I didn't have the time to try this again. Will do when possible But indeed, it's possible that I was it was wrong and it happens only for I'm trying to understand an issue on one of my projects, so trying different things to see if I find the problem |
You're right that this only happen when using Closing this |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Reproduce
I think this is specific to macOS. Although I haven't tried the exact script below on another OS, I'm sure I ran similar scripts on Windows and Linux before and it worked fine
Given any long running executable:
Suppose we want to run the program above, but kill it after 5 seconds:
The script above exits with a panic, but the server keeps running in background
I also tried to kill the process directly, but got the same result:
The interesting fact is that if I press
Control+C
before those 5 seconds then the server is killed without any problemThe text was updated successfully, but these errors were encountered: