spring-framework
spring-framework copied to clipboard
CRaC support: Checkpoint failing with CheckpointOpenSocketException
Trying to create check point in spring boot application but failing with the below error
jdk.crac.impl.CheckpointOpenSocketException: tcp6 localAddr :: localPort 8088 remoteAddr :: remotePort 0 at java.base/jdk.crac.Core.translateJVMExceptions(Core.java:88) at java.base/jdk.crac.Core.checkpointRestore1(Core.java:142) at java.base/jdk.crac.Core.checkpointRestore(Core.java:237) at java.base/jdk.crac.Core.lambda$checkpointRestoreInternal$3(Core.java:259) at java.base/java.lang.Thread.run(Thread.java:833)
I used the spring.context.checkpoint=onRefresh in application.yml file.
Implemented beforeCheckpoint method and close the connection opened by application. However spring web server is not being closed and throwing exception.
jdk : openjdk-17-crac+3_linux-x64 springBootVersion = "3.3.0"
Appreciate any pointer and solution on this
spring.context.checkpoint=onRefresh is not a Spring Boot property you should set in application.yml but a JVM system property as documented here. I suggest you fix your use case accordingly by using java -Dspring.context.exit=onRefresh ..., you should not have to implement beforeCheckpoint to close the connection opened by the application. https://github.com/spring-projects/spring-lifecycle-smoke-tests/ provides addition guidance for database etc.
if you still reproduce, please provide a self contained reproducer as a link to a repository or an attached project with the steps to reproduce. If you don't, please close this issue.
If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.
Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.