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

Adds afterStart(WebServer) implementations to various delegating ServerLifecycle implementations that were missing it #9820

Merged

Conversation

ljnelson
Copy link
Member

PR #9655 added an afterStart(WebServer) method to ServerLifecycle. It was approved on February 4. There were more ServerLifecycle implementations than showed up at first glance. This PR attempts to ensure that all of the known ServerLifecycle implementations in the code base do the right thing with their afterStart(WebServer) implementations, so that they don't simply (incorrectly) inherit the (necessary) default "no-op" implementation.

This PR gates #9704 and #9789.

…erLifecycle implementations that were missing it

Signed-off-by: Laird Nelson <laird.nelson@oracle.com>
@ljnelson ljnelson added bug Something isn't working webserver 4.x Version 4.x labels Feb 21, 2025
@ljnelson ljnelson added this to the 4.2.0 milestone Feb 21, 2025
@ljnelson ljnelson self-assigned this Feb 21, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Feb 21, 2025
@ljnelson ljnelson requested a review from tjquinno February 21, 2025 03:57
Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

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

IIRC an app can start multiple web servers (probably very rare, but I think possible?). The afterStart method accepts a WebServer as a parameter, but the afterStop method does not. Presumably some afterStart logic could do webserver-dependent things and might need to distinguish among which of the previously-started web servers has been stopped during its afterStop processing. Such code has no way of doing so with the current afterStop API.

Certainly if at most one webserver can ever be started in a JVM then this is a non-issue.

@ljnelson
Copy link
Member Author

IIRC an app can start multiple web servers (probably very rare, but I think possible?). The afterStart method accepts a WebServer as a parameter, but the afterStop method does not. Presumably some afterStart logic could do webserver-dependent things and might need to distinguish among which of the previously-started web servers has been stopped during its afterStop processing. Such code has no way of doing so with the current afterStop API.

Certainly if at most one webserver can ever be started in a JVM then this is a non-issue.

All fair points in my opinion. I'm also not particularly crazy about the fact that the "webserver is up!" "event" is buried in, for practical purposes, a routing, when the thing reacting to the event reception may have nothing to do with routing.

The scope of this PR, however, is simply to add (required) implementations of the afterStart(WebServer) method where I missed them the first time; they should have been included in #9655.

Copy link
Member

@tjquinno tjquinno left a comment

Choose a reason for hiding this comment

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

LGTM

@ljnelson ljnelson merged commit 0292d9b into helidon-io:main Feb 21, 2025
62 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x Version 4.x bug Something isn't working OCA Verified All contributors have signed the Oracle Contributor Agreement. webserver
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants