Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-09-23 11:49:59 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-10-07 10:14:27 +0300
commit401a62b5e69d8ce10993c54cd705df287b42b5c6 (patch)
tree887956a56aeb1170708db4b2b9bcc6d0368deacf
parentf501a33d8a9a2c10b2e7bf76d123f878c7dd2c86 (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.
-rw-r--r--cmd/praefect/main.go2
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))
}