refact(controller): Decouple listeners/servers shutdown from Worker

In general, these changes were introduced in the same vein of the
changes to controller `startListeners`.

Specifically, these changes also decouple the Controller and the Worker
shutdown processes. Currently, a call to `stopListeners` on an instance
that is running as both a Controller and a Worker would stop the
listeners for both.

Lastly, we also add unit/integration tests to the shutdown code.
This commit is contained in:
Hugo Vieira committed 2022-03-25 15:04:23 +00:00
1 parent d438a6d2dd
commit eebdfb88dc
9 files changed
+572 -72

No files matched your search

+1 -1
View File
@@ -279,7 +279,7 @@ func (tc *TestController) Shutdown() {
tc.cancel()
if tc.c != nil {
if err := tc.c.Shutdown(false); err != nil {
if err := tc.c.Shutdown(); err != nil {
tc.t.Error(err)
}
}