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

Review WebServers' auto-start behavior #44656

Open
wilkinsona opened this issue Mar 10, 2025 · 0 comments
Open

Review WebServers' auto-start behavior #44656

wilkinsona opened this issue Mar 10, 2025 · 0 comments
Labels
status: pending-design-work Needs design work before any code can be developed type: task A general task
Milestone

Comments

@wilkinsona
Copy link
Member

wilkinsona commented Mar 10, 2025

Auto-start was introduced before 1.0. The intent appears to have been to prevent the server from starting. At the time it was when the port was set to 0. It's now when the port is set to a negative value. ServletContextAware is also mentioned which suggests that such components should still be called with the current ServletContext.

I think the name autoStart is misleading. It doesn't control whether the web server will be started automatically, but what start will do. Put another way, calling start() on a web server with auto-start disabled does not put it in the same state as one that was created with auto-start enabled.

We have four web servers now, and various behaviors when auto-start is disabled:

WebServer Auto-start disabled behavior
NettyWebServer No auto-start support
JettyWebServer Server isn't started at all
TomcatWebServer Tomcat is started but the connector's protocol handler is stopped
UndertowWebServer Undertow instance isn't even created

With the opportunity that 4.0 provides for breaking changes, we should review the auto-start behavior. Given the inconsistency of the current implementations we should consider if the feature's needed at all. It also doesn't appear to be documented so it perhaps isn't widely used. If we want to keep it, we should, if possible, offer consistent behavior across all web servers. We should also consider renaming it.

@wilkinsona wilkinsona added status: pending-design-work Needs design work before any code can be developed type: task A general task labels Mar 10, 2025
@wilkinsona wilkinsona added this to the 4.0.x milestone Mar 10, 2025
@wilkinsona wilkinsona changed the title Review WebServer's auto-start behavior Review WebServers' auto-start behavior Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending-design-work Needs design work before any code can be developed type: task A general task
Projects
None yet
Development

No branches or pull requests

1 participant