From ccd0200bd9caba7236d1dbb8254421da4ef709ff Mon Sep 17 00:00:00 2001 From: "R.B. Boyer" Date: Wed, 30 Sep 2020 16:23:43 -0500 Subject: [PATCH] server: ensure that we also shutdown network segment serf instances on server shutdown (#8786) This really only matters for unit tests, since typically if an agent shuts down its server, it follows that up by exiting the process, which would also clean up all of the networking anyway. --- .changelog/8786.txt | 3 +++ agent/consul/server.go | 4 ++++ 2 files changed, 7 insertions(+) create mode 100644 .changelog/8786.txt diff --git a/.changelog/8786.txt b/.changelog/8786.txt new file mode 100644 index 000000000..649b4d045 --- /dev/null +++ b/.changelog/8786.txt @@ -0,0 +1,3 @@ +```release-note:improvement +server: **(Consul Enterprise only)** ensure that we also shutdown network segment serf instances on server shutdown +``` diff --git a/agent/consul/server.go b/agent/consul/server.go index a478d0c39..57f799472 100644 --- a/agent/consul/server.go +++ b/agent/consul/server.go @@ -914,6 +914,10 @@ func (s *Server) Shutdown() error { s.serfLAN.Shutdown() } + for _, segment := range s.segmentLAN { + segment.Shutdown() + } + if s.serfWAN != nil { s.serfWAN.Shutdown() if err := s.router.RemoveArea(types.AreaWAN); err != nil {