Whoops! Missed this earlier.
By default, a deploy does a canary + rolling restart. This means it’ll boot the first instance, wait for health checks, and then promote the canary. When this happens, it goes to a rolling process. The rolling deploy stops one instance, boots another, stops another instance, etc.
What you’re seeing is basically this sequence:
- Canary boots, health checks pass
- Canary gets promoted, replacing old instance #1
- Old instance #2 stops (rolling deploy)
- New instance #2 starts
If you had three instances:
- Canary boots, health checks pass
- Canary gets promoted, replacing old instance #1
- Old instance #2 stops (rolling deploy)
- New instance #2 starts
- Old instance #3 stops
- New instance #3 starts
Now that I’ve written all that out, I realize it’s mildly confusing for 2 instance apps. It might be more predictable to do a blue/green deploy, or repeat the canary process all l the way through.
Regarding logs + SIGINT, you should see log messages after SIGINT if you’re still producing them. Is it possible the process is shutting down very quickly on SIGINT?
I ended up replacing a bunch of bash with Go as well. It’s so handy and … compiles.