move jetty module to Lifecycle.Stage.LAST#7215
Merged
gianm merged 1 commit intoapache:masterfrom Mar 9, 2019
Merged
Conversation
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle
gianm
approved these changes
Mar 9, 2019
Contributor
gianm
left a comment
There was a problem hiding this comment.
👍
Seems like a reasonable solution to the problem.
gianm
pushed a commit
to implydata/druid-public
that referenced
this pull request
Mar 9, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
gianm
pushed a commit
to implydata/druid-public
that referenced
this pull request
Mar 11, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
Contributor
|
@clintropolis - I just realized that this may not actually solve the problem. It fixes one problem (Jetty stopping before the lookups module) but, I think, introduces another one. In the "after" log, Jetty stops before the historical unannounces itself fully: Since the server is still announced in a way that the Broker ServerView can see, queries will keep coming in to it even after Jetty is stopped. To address this, I believe the SegmentLoadDropHandler, which manages the |
gianm
added a commit
to implydata/druid-public
that referenced
this pull request
Mar 11, 2019
…hutdown to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)" This reverts commit 028d9e9.
Member
Author
|
Yes, this is correct for curator based segment discovery, I will resolve the issue in a follow-up PR. |
gianm
added a commit
to implydata/druid-public
that referenced
this pull request
Mar 11, 2019
…hutdown to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)" This reverts commit 4696363.
gianm
pushed a commit
to implydata/druid-public
that referenced
this pull request
Mar 14, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
gianm
pushed a commit
to implydata/druid-public
that referenced
this pull request
Apr 8, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
gianm
pushed a commit
to implydata/druid-public
that referenced
this pull request
Apr 14, 2019
…to work with lookups and stuff, put http-clint on lifecycle modules lifecycle (apache#7215)
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.
#5429 added graceful shutdown for jetty to allow queries the chance to complete successfully, which is rad. However, some things, such as lookup module, just can't be bothered to care, and the module stops before the jetty module and closes lookups. The end result is that even though jetty will allow in flight queries time to complete, they will not be able to do so because lookups or another failure as a result of already stopped modules.
This PR moves the jetty module to
Lifecycle.Stage.LAST, which effectively makes jetty the 2nd to last thing to start before the server announces itself for discovery, and the 2nd module to stop, immediately after the discovery module stops (or after the delay ifdruid.server.http.unannouncePropogationDelayis set).This PR also moves 'http-client' onto the lifecycle of the
LifecycleModuleinstead of creating it's ownLifecyclethat was attached to the modules lifecycle. I believe this was an artifact of when it was injava-utiland using theLifecyclefrom that library, and is not necessary.I haven't thought of a great way to write tests for this, but I have tested in a small cluster on my dev machine, and can provide a log to show the effect the change has.
Note that before the change, many things are stopped before jetty such as
LookupReferencesManager,DruidLeaderClient,CuratorDruidNodeDiscoveryProvider, andNettyHttpClientamong other things.before:
after: