diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-09-23 11:49:59 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-10-07 10:14:27 +0300 |
commit | 401a62b5e69d8ce10993c54cd705df287b42b5c6 (patch) | |
tree | 887956a56aeb1170708db4b2b9bcc6d0368deacf /cmd/praefect/main.go | |
parent | f501a33d8a9a2c10b2e7bf76d123f878c7dd2c86 (diff) |
praefect: Stop gRPC servers on exit
Next to a bunch of other things, the Praefect server's `run()` function
also has the task to create the gRPC servers. These servers are never
stopped though, which as a result means that we leak listeners set up
for this server in our tests.
Fix this by calling `Stop()` on these servers.
Diffstat (limited to 'cmd/praefect/main.go')
-rw-r--r-- | cmd/praefect/main.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/praefect/main.go b/cmd/praefect/main.go index 743578b1b..44a0981f0 100644 --- a/cmd/praefect/main.go +++ b/cmd/praefect/main.go @@ -402,6 +402,8 @@ func run(cfgs []starter.Config, conf config.Config) error { if err != nil { return fmt.Errorf("create gRPC server: %w", err) } + defer srv.Stop() + b.RegisterStarter(starter.New(cfg, srv)) } |