-
Notifications
You must be signed in to change notification settings - Fork 38.4k
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
ReactorResourceFactory
not working with CRaC onRefresh checkpoint
#32945
Comments
|
The problem is that with -Dspring.context.checkpoint=onRefresh beans are not started so stop isn't called on Lifecyle beans. If you later after a start event do a manual jcmd JDK.checkpoint the lifecycle beans are stopped and everything is fine. So currently when you do a checkpoint with -Dspring.context.checkpoint=onRefresh Lifcycle beans don't take part in the beforeCheckpoint and afterRestore process of CRaC as we haven't reached the start point of Lifcycle. Hope this helps to understand the problem without providing an example project? |
Thanks for the detailed explanation, but a repro is still welcomed, especially for this kind of issue where the devil is usually in the details. |
I did a fork of your spring-boot-crac-demo: https://github.com/frederikz/spring-boot-crac-demo |
@sdeleuze looking at the Could we simply remove the InitializingBean/DisposableBean methods there and rather implement |
ReactorResourceFactory
not working with CRaC
ReactorResourceFactory
not working with CRaCReactorResourceFactory
not working with CRaC onRefresh checkpoint
A new |
It seems like calling the start method was required before the start lifecycle. For a quick test I directly replaced only the changed ReactorResourceFactory.class in my spring-web-6.1.8.jar and now I get this exception:
|
We also got a similar phase mismatch with Boot's |
I've pushed another revision. Please let me know whether the upcoming 6.1.9 snapshot works for your purposes now... either through upgrading the entire |
Thanks, works. |
I have a spring boot 3.3.0 application running with embedded tomcat which uses WebClient. When I try out CRaC and generate a checkpoint with -Dspring.context.checkpoint=onRefresh
I get errors during checkpoint creation. The cause is org.springframework.http.client.ReactorResourceFactory which is already started in afterPropertiesSet. I could prevent the errors by implementing a org.crac.Resource that stops the ReactorResourceFactory beforeCheckpoint. As I have some other problems I couldn't try if everything would be fine if I start it again in afterRestore.
Errors during checkpoint creation:
I don't know what the reason is that ReactorResourceFactory is already started in afterPropertiesSet. Either don't start it already in afterPropertiesSet or provide a org.crac.Resource implementation that stops it before a checkpoint (at least when the checkpoint is made onRefresh as later after start phase it is alrady stopped by the lifecycle implementation) and starts again after restore.
The text was updated successfully, but these errors were encountered: