feat: implement graceful shutdown
What does this MR do?
Close connections and listener and wait for the server to shutdown properly.
Closes #539 (closed)
Closes #680 (closed)
Note: wg.Wait()
was removed because the metrics server doesn't handle interrupts.
cc @jaime @vshushlin
TODO
-
I added the Changelog
trailer (e.g.Changelog: added
) to the commits that need to be included in the changelog -
I added unit tests or they are not required -
I added acceptance tests or they are not required -
I added documentation (or it's not required) -
I followed code review guidelines -
I followed Go Style guidelines