-
Notifications
You must be signed in to change notification settings - Fork 158
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
Restart the program if it fails #72
Comments
mitar
changed the title
Restart the program if if fails
Restart the program if it fails
Feb 24, 2022
If you need more sophisticated job management I would recommend using a shell script that launches the executable and watches for the actual program. A very simple one would be something like #!/bin/bash
while true; do
./my_go_executable "$@"
sleep 5 # avoid flooding the system with crashing applications
done I don't think this is a job for |
ederuiter
added a commit
to thisisdevelopment/CompileDaemon
that referenced
this issue
Jul 9, 2022
See https://medium.com/@felixge/killing-a-child-process-and-all-of-its-children-in-go-54079af9477 for a detailed explanation of how this works. For now this only implemented for posix and these changes should have no effect on windows. This fixes githubnemo#65 and makes the script in githubnemo#72 work (without this fix the script would be terminated on re-compile, but the go executable would continue to run, potentially causing issues with used resources like files and sockets)
I have a commit on a fork that does this: asalkeld@238f1e6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sometimes a running program fails because of the panic. Because CompileDaemon keeps running it is hard to notice that (except for the panic stack trace). I think it would be best if CompileDaemon would just restart the program, with some message (like, "program terminated, restarting"). Probably as opt-in CLI flag.
The text was updated successfully, but these errors were encountered: