Closed danlamanna closed 1 year ago
Good catch! Silently failing never a good idea!
Not a fan of log.Fatal
though. That calls os.Exit
and will bypass any cleanup code we add in the future, increasing the chance of introducing bugs down the line.
Mind refactoring to just log.Println
the error, and signal the shutdown channel any time that goroutine ends? Should probably cleanup the channel's name and shutdown log string since this this path now runs for cases other than sigterm?
Should probably os.Exit(1)
since program is essentially falling here... still torn on skipping any shutdown code though -- that always leads to bugs later. Maybe capture the error and keep single exit path.
I'm not sure how to cleanly do this with one channel (not a Go programmer) since I can't put a Signal | string
on a single channel, I don't think.
Merging into a branch to make some tweaks before master
This makes server startup against an already bound port display:
Instead of being indistinguishable from a successful start.