.*: Add new http-grace-period flag#1680
Merged
bwplotka merged 5 commits intothanos-io:masterfrom Oct 24, 2019
Merged
Conversation
79164ed to
882780b
Compare
bwplotka
approved these changes
Oct 24, 2019
Member
bwplotka
left a comment
There was a problem hiding this comment.
Nice! One comment and LGTM, maybe we could increase timeout a bit.
Wonder can we have similiar for gRPC 🤔 ? We would need something like grpc/grpc-go#2448
Also we used to have no timeout I guess? So adding 5s make sense. We were not draining even really.
We would need something like grpc/grpc-go#2448
Member
Author
|
@bwplotka Yes, definitely. Great idea, I'll add a grace period and draining logic for gRPC as well in another PR. |
Member
|
you need to sign commits + CI failure |
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Co-Authored-By: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com>
2bc7b6f to
c54e35d
Compare
vmg
added a commit
to vmg/thanos
that referenced
this pull request
Oct 28, 2019
PR thanos-io#1680 introduced graceful handling for the HTTP server in Thanos, but the graceful `Shutdown` call was being performed on an `http.Server` instance that was *not* running at all. The actual server that was listening for requests was started through `http.Serve`, so there was no reference to the server struct that we could use to shut it down. This was causing all of Thanos to freeze after receiving an exit signal, because the run-group for the HTTP server would never finalize. This seems like an oversight because the `(*Server).srv` field was being properly initialized with an HTTP server. Fix this by calling `ListenAndServe` on our initialized server. Signed-off-by: Vicent Marti <vmg@strn.cat>
2 tasks
bwplotka
pushed a commit
that referenced
this pull request
Oct 28, 2019
PR #1680 introduced graceful handling for the HTTP server in Thanos, but the graceful `Shutdown` call was being performed on an `http.Server` instance that was *not* running at all. The actual server that was listening for requests was started through `http.Serve`, so there was no reference to the server struct that we could use to shut it down. This was causing all of Thanos to freeze after receiving an exit signal, because the run-group for the HTTP server would never finalize. This seems like an oversight because the `(*Server).srv` field was being properly initialized with an HTTP server. Fix this by calling `ListenAndServe` on our initialized server. Signed-off-by: Vicent Marti <vmg@strn.cat>
GiedriusS
pushed a commit
that referenced
this pull request
Oct 28, 2019
* Add new http-grace-period flag Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com> * Update CHANGELOG Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com> * Update docs Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com> * Update pkg/server/http.go Co-Authored-By: Bartlomiej Plotka <bwplotka@gmail.com> Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com> * Rename initializer for HTTP server Signed-off-by: Kemal Akkoyun <kakkoyun@gmail.com> Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
GiedriusS
pushed a commit
that referenced
this pull request
Oct 28, 2019
PR #1680 introduced graceful handling for the HTTP server in Thanos, but the graceful `Shutdown` call was being performed on an `http.Server` instance that was *not* running at all. The actual server that was listening for requests was started through `http.Serve`, so there was no reference to the server struct that we could use to shut it down. This was causing all of Thanos to freeze after receiving an exit signal, because the run-group for the HTTP server would never finalize. This seems like an oversight because the `(*Server).srv` field was being properly initialized with an HTTP server. Fix this by calling `ListenAndServe` on our initialized server. Signed-off-by: Vicent Marti <vmg@strn.cat> Signed-off-by: Giedrius Statkevičius <giedriuswork@gmail.com>
Member
|
This is great! I really like the new package and grace period is definitely good thing to have 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds a new CLI flag to components which serve HTTP, called
--http-grace-period.Also refactors existing code and introduces a new HTTP server package, to increase the clarity of the
run.Groupscheduling.cc @bwplotka @FUSAKLA
Signed-off-by: Kemal Akkoyun kakkoyun@gmail.com
Changes
--http-grace-periodCLI flag to components which serve HTTP.scheduleHTTPServerfunction and introduces a new package to handle HTTP serving.Verification
make local-test./scripts/quickstart.sh