-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Proposal for Early Connector Start #10664
Conversation
Signed-off-by: Joakim Erdfelt <[email protected]>
@@ -44,7 +44,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques | |||
{ | |||
Handler[] handlers = getHandlers(); | |||
|
|||
if (handlers != null && isStarted()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is potentially controversial, as in order for the example in the PR to work, this isStarted()
check cannot be here.
This seems arbitrary and not all Handler do this check.
Eg: ContextHandlerCollection
and GzipHandler
do not check isStarted()
, BUT HandlerList
, HandlerCollection
, and RewriteHandler
do.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that checking is a bit arbitrary, but the check should be valid non-the-less
Signed-off-by: Joakim Erdfelt <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is being looked at the wrong way. You don't want to start the connectors early, you want to deploy the webapps late (after everything else is started).
You could achieve this by not adding the deployer to the server until after the server is started. Or perhaps have an option of the app provider to not scan for apps during doStart and only scan after start.
@@ -44,7 +44,7 @@ public void handle(String target, Request baseRequest, HttpServletRequest reques | |||
{ | |||
Handler[] handlers = getHandlers(); | |||
|
|||
if (handlers != null && isStarted()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that checking is a bit arbitrary, but the check should be valid non-the-less
To give a bit more detail.... I think the best approach is to delay deploying the webapps, which could be done in one of several ways:
All these could be done simply enough with embedded usage of Jetty. But we'd need to modify the Deployer if we want this behaviour from a |
I have a different idea to try, different PR incoming. |
Closing in favor of approach in PR #10667 |
This is proposal for offering a way to start connectors early for those deployments that want to have inter-context / inter-handler communications (via http requests) during the Server startup.
Such as having webappA deploy before webappB.
Then webappB having a load-on-start servlet init that makes an HTTP request to webappA to access something from it.