Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.*: Introduce graceful shutdown for gRPC Servers #1687

Merged
merged 11 commits into from
Nov 1, 2019

Conversation

kakkoyun
Copy link
Member

@kakkoyun kakkoyun commented Oct 25, 2019

This PR,

  • introduces a grace period for components which use gRPC to wait (5s by default) for connections to drain before the shutdown.
  • adds a new --grpc-grace-period CLI option to specify the period.

Signed-off-by: Kemal Akkoyun [email protected]

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

  • Add a new --grpc-grace-period CLI option to components which serve gRPC to set how long to wait until gRPC Server shuts down.
  • Components which use gRPC Server now wait (5s by default) for connections to drain before the shutdown.

Verification

  • make test-local
  • MINIO_ENABLED=1 ./scripts/quickstart.sh

@kakkoyun
Copy link
Member Author

This should be rebased and include the fixes that will be introduced after #1689 merged.

@kakkoyun kakkoyun marked this pull request as ready for review October 28, 2019 17:07
@kakkoyun
Copy link
Member Author

cc @bwplotka @squat @brancz

I have tried to be extra careful, in order to prevent issues such as #1689, I'd be glad if you can double-check the work.

Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, but good to have another pair of eyes on this I think cc @squat @bwplotka

@kakkoyun
Copy link
Member Author

kakkoyun commented Oct 30, 2019

This PR might have conflicting changes with #1672

@brancz
Copy link
Member

brancz commented Oct 30, 2019

My personal opinion, this PR is larger and would be harder to rebase than #1672, so I'd prefer to merge this first.

pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
pkg/server/http/http.go Outdated Show resolved Hide resolved
pkg/tls/options.go Outdated Show resolved Hide resolved
pkg/tls/options.go Outdated Show resolved Hide resolved
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, @kakkoyun :))) I have some nits but nothing major

pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
pkg/server/grpc/grpc.go Outdated Show resolved Hide resolved
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, it looks good, but have some minor comments (:

cmd/thanos/flags.go Outdated Show resolved Hide resolved
cmd/thanos/query.go Show resolved Hide resolved
cmd/thanos/rule.go Show resolved Hide resolved
cmd/thanos/sidecar.go Outdated Show resolved Hide resolved
cmd/thanos/sidecar.go Show resolved Hide resolved
pkg/server/grpc/grpc.go Show resolved Hide resolved
pkg/server/grpc/grpc.go Show resolved Hide resolved
pkg/server/grpc/option.go Show resolved Hide resolved
pkg/server/http/http.go Outdated Show resolved Hide resolved
@kakkoyun kakkoyun changed the title Introduce graceful shutdown for gRPC Servers .*: Introduce graceful shutdown for gRPC Servers Oct 30, 2019
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go with this! Good work, thanks 👍

Let's rebase and merge.

Signed-off-by: Kemal Akkoyun <[email protected]>
@kakkoyun
Copy link
Member Author

kakkoyun commented Nov 1, 2019

@bwplotka Is CI failure a Netlify issue? Is it something related to these changes?

Signed-off-by: Kemal Akkoyun <[email protected]>
Signed-off-by: Kemal Akkoyun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants