-
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
Add configuration to allow deferring the initial Deployment until after Server is started #10667
Conversation
Signed-off-by: Joakim Erdfelt <[email protected]>
This needs unit tests still. |
Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
… started. 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 approach achieve the goal.... but it might be simpler to make a change to the scanner itself. Specifically reportExisting
is not sufficient, I think the doStart of the scanner could be modified to look like:
if (_scanInStart)
{
if (_reportExisting)
{
// if files exist at startup, report them
scan();
scan(); // scan twice so files reported as stable
}
else
{
//just register the list of existing files and only report changes
_prevScan = scanFiles();
}
}
That way you could add the scanner normally in the AppProvider and the listener would only need to do a nudge.
jetty-deploy/src/main/java/org/eclipse/jetty/deploy/providers/ScanningAppProvider.java
Outdated
Show resolved
Hide resolved
Perhaps this approach is best for this release cycle and we can consider improving the implementation by changing the scanner in the next release cycle. @janbartel thoughts? |
Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
@gregw doh! I already made the change to the Scanner in this branch / PR. |
Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
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.
LGTM
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.
Some name changes to better indicate what is going on: we're not deferring the initial scan, we're deferring starting the whole scan cycle. Also need to remove extra call (currently to startup()
) in doStart()
.
We are deferring the initial scan. The We use the term "initial scan" in other javadoc currently (like |
@janbartel also, something to think about, what would you call the |
Signed-off-by: Joakim Erdfelt <[email protected]>
@janbartel I committed a pass at better naming. |
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 don't think I really love any of the possible naming changes, even ones I suggested :), so happy to go with the majority decision there. But the call to manually start the scheduler is something that I really want removed.
Signed-off-by: Joakim Erdfelt <[email protected]>
@gregw @janbartel The manual scheduler start is removed in this version. |
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.
Conditional approval. You need to fix a few javadoc comments.
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.
Couple of javadoc fixes, and it would be good if the test could be more specific that the webapp is not actually deployed at the point in time the DeploymentManager/Scanner starts.
jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java
Show resolved
Hide resolved
jetty-deploy/src/test/java/org/eclipse/jetty/deploy/providers/WebAppProviderTest.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Joakim Erdfelt <[email protected]>
Signed-off-by: Joakim Erdfelt <[email protected]>
@janbartel @gregw I went ahead and applied all of the javadoc changes requested, along with improvements on testDelayedDeploy() to ensure the order of events is sane. (started components and initial scans) |
Jetty 10.0.18 accidentally added dependencies on `awaitility` and `hamcrest` in `jetty-deploy` via jetty/jetty.project#10667 This workaround can be removed once jetty/jetty.project#10812 is addressed.
<dependency> | ||
<groupId>org.awaitility</groupId> | ||
<artifactId>awaitility</artifactId> | ||
</dependency> |
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.
Oops, wrong missing <scope>test</scope>
!
Submitted a PR to correct at #10813
Introduce a
WebAppProvider
(andScanningAppProvider
) configuration.setDeferInitialScan(boolean)
(defaults to false), which controls the initial deployment of webapps.true
= to have initial scan deferred until theServer
component has reached it's STARTED state.false
= (default) to have initial scan occur as normal onScanningAppProvider
startup.Notes:
Having
true
set will not fail theServer
startup.Having
false
be default allows for failed deployments to also fail the server start.Fixes #10669