-
Notifications
You must be signed in to change notification settings - Fork 40.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
Allow WebServers to be stopped and restarted #34955
Comments
From a quick glance at the To be clear, in the Spring bean lifecycle, the main purpose of I recommend revising |
Since we might be using Spring Boot 3.1 for early demos with Project CRaC, it would be great to fix this ASAP for that reason as well. @wilkinsona @bclozel for your consideration, I hope this is a simple enough revision. |
Depending on the complexity of the fix, I'd consider fixing this one in 3.0.x or even 2.7.x. |
@markt-asf Looking at some differences in the state after calling |
There's a similar problem with Undertow. I've opened #35184. |
Theoretically yes, but that would be a bug in Tomcat (or the application code) that should have shut those tasks down when the associated component shut down. |
Thanks, Mark. While it sounds like we don't need to worry about the executor being left running, I wonder if it could be stopped in |
That looks possible. I'll start a thread on the Tomcat dev@ list to discuss the possibility. |
Separating |
Getting the context ready for use is currently split across three protected methods:
The reasons for the split aren't clear to me. |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
I've broadened the scope of this beyond Tomcat. We can also support stop and restart with Jetty (servlet and reactive). It does not appear to be possible to support stop and restart with Undertow, particularly for Servlet-based apps. It should also work with Reactor Netty, although perhaps not as efficiently as it could do. We can refine in the future as needs be. |
On a plain web Spring Boot (3.0.5) application if one do
context.stop()
and thencontext.start()
the context on a I get an error:To reproduce create a plain web boot application
SpringWebCracApplication
like this:It looks like the
tomcat.destroy()
, called oncontext.stop()
, destroys theTomcat.Context
and later is not re-created on start.Note that If we replace the
Tomcat
with aJetty
the application works fine and recovers after stop/start.The text was updated successfully, but these errors were encountered: