Skip to content

Commit

Permalink
GracefulStop first
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonip committed Oct 11, 2024
1 parent ed864d5 commit a700622
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions internal/beater/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,10 @@ func (s server) run(ctx context.Context) error {
})
g.Go(func() error {
<-ctx.Done()
s.grpcServer.GracefulStop()
stopctx, cancel := context.WithTimeout(context.Background(), s.cfg.ShutdownTimeout)
defer cancel()
s.httpServer.stop(stopctx)
// FIXME: will httpServer.stop terminate the grpc connections, making grpcServer.GracefulStop a no-op?
// Will it be better to grpcServer.GracefulStop first as the gmux panic is fixed, so that GOAWAY is sent?
s.grpcServer.GracefulStop()
return nil
})
if err := g.Wait(); err != http.ErrServerClosed {
Expand Down

0 comments on commit a700622

Please sign in to comment.