Review WebServers' auto-start behavior #44656
Labels
status: pending-design-work
Needs design work before any code can be developed
type: task
A general task
Milestone
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 currentServletContext
.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, callingstart()
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:
NettyWebServer
JettyWebServer
Server
isn't started at allTomcatWebServer
UndertowWebServer
Undertow
instance isn't even createdWith 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.
The text was updated successfully, but these errors were encountered: