-
Notifications
You must be signed in to change notification settings - Fork 38.5k
Can't create a CRaC checkpoint if a RestTemplate and RestClient is used during warmup, resulting in open socket exceptions #33196
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
Comments
I expect it should work based on the lifecycle smoke test we have for that use case, but in order to make I am not on Linux to please test that on your sample and let me know how it goes. |
Thanks for the suggestion! I have verified that the lifecycle smoke test for a After that, my plan was to move my
But the app will not start after removing this line, complaining about:
I don't understand why the Can you explain? |
Indeed, not all underlying HTTP client engines are CRaC friendly, Netty should work for both Sorry but Spring Framework bug tracker is probably not the best place to discuss such Spring Boot sample refinement. Maybe try it the other way by adding Reactor Netty dependency to your repro and use the builder. I will close this issue as I think CRaC support is working as expected here (it requires by design a specific arrangement). If you are find an issue, please drop a comment and I will reopen this issue. |
Thanks for your help! I managed to configure the For others who might stumble into the same problem, here is a summary of my resolution:
I have pushed a working solution for my project to the branch I have also added instructions to the |
Uh oh!
There was an error while loading. Please reload this page.
Using a RestTemplate or RestClient bean to make HTTP requests during warmup before creating a CRaC checkpoint using the
jcmd myapp.jar JDK.checkpoint
command results in open socket exceptions when creating the checkpoint.I have created a project on GitHub to reproduce the problem; see https://github.com/magnus-larsson/ml-spring-http-client-crac-error-demo.
The
README.md
file contains instructions for how to reproduce the problem, but to summarise, run the following commands in a Linux environment with a Java 21 JDK that supports CRaC:It will result in
jdk.internal.crac.mirror.impl.CheckpointOpenSocketException
exceptions.The text was updated successfully, but these errors were encountered: