-
Notifications
You must be signed in to change notification settings - Fork 231
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
Realize is not killing the current app #247
Comments
Please let me know if I´m missing a command that changes this behaviour |
I am having a same problem. Hopefully author will fix this. |
I too am having the same problem. My app runs a webserver and also runs workers that wait to finish jobs before exiting when requested to exit. So what ends up happening is the newly built version runs before the previous command has exited cleanly, and my app complains that the http port is already in use and fails. Given that I want my jobs to complete and not have the app killed forcefully, perhaps realize could make sure the previous command has ended before starting a new one. A config setting for the termination type, forceful or clean might be useful? |
Same issue here |
Well after some time on research, I figure out a workaround to fix this problem. Basically you need to run a command every restart. Inside a linux container, I did this with my .realize.yaml file: # ...
watcher:
scripts:
- type: before
command: pkill server-api
output: true |
Currently when you build a webserver in go, realize will not restart the app on change but will run the new one in parallel.
Expected:
When you change an app and the original is still running, realize should stop the old version and start the new version
Actual Behaviour
Realize runs old and new versions of the app in parallel.
Reproduction
main.go
.realize.yaml
Now start realize with "realize start".
[13:56:23][GO-SERVER] : Install started [13:56:24][GO-SERVER] : Install completed in 1.671 s [13:56:24][GO-SERVER] : Build started [13:56:26][GO-SERVER] : Build completed in 1.634 s [13:56:26][GO-SERVER] : Running..
Change something in your go-code
[13:56:23][GO-SERVER] : Install started [13:56:24][GO-SERVER] : Install completed in 1.671 s [13:56:24][GO-SERVER] : Build started [13:56:26][GO-SERVER] : Build completed in 1.634 s [13:56:26][GO-SERVER] : Running.. [13:56:57][GO-SERVER] : GO changed D:\go-server\main.go [13:56:58][GO-SERVER] : Install started [13:56:59][GO-SERVER] : Install completed in 1.291 s [13:57:00][GO-SERVER] : Build started [13:57:01][GO-SERVER] : Build completed in 1.591 s [13:57:01][GO-SERVER] : Running.. [13:57:01][GO-SERVER] : 2019/05/17 13:57:01 listen tcp :8080: bind: Normalerweise darf jede Socketadresse (Protokoll, Netzwerkadresse oder Anschluss) nur jeweils einmal verwendet werden.
Translation for last line: " Normaly each socket adress should only be used once"
The text was updated successfully, but these errors were encountered: