-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Random CancellationException instead of ResourceAccessException after upgrading to Spring Boot 3.4.0 #33973
Comments
Thanks for the sample. Unfortunately, on my machine, it doesn't reproduce the behavior that you've described. I've tried with both Java 21 and Java 23 and the exception was always a Can you please provide some more information about the OS you're running on and the version and distribution of Java that you're using? Also, please share the full stack trace of both the |
Hey @wilkinsona Thank you for looking into this issue. Here is the information about my local machine, which I used to run the example: Machine Details: Device: MacBook Pro Stack Traces from the Example:
In addition, this issue first appeared in our application running as a GCP CloudRun service. The service operates using the following base image: Let me know if you need more details about the environment! |
Thanks for the additional details and stack traces. The change in behavior that you've seen upon upgrading to Spring Boot 3.4 is due to this change in Spring Framework. We'll transfer this issue to the Framework team so that they can continue the investigation. |
Hi there, I’ve updated my example project to include additional test scenarios:
I hope these additions help with your investigation. Thank you for your support! |
Hi Spring-Team,
After upgrading to Spring Boot 3.4.0, we have encountered an issue with RestTemplate where random CancellationExceptions are thrown instead of the expected ResourceAccessException during timeout scenarios.
Observations:
This behavior is inconsistent; sometimes a CancellationException is thrown, and other times a ResourceAccessException is thrown.
This issue did not occur in previous versions of Spring Boot.
Reproduction:
We have created a test case to demonstrate the issue: https://github.com/SimonPNorra/timeout-execption-case
Steps to Reproduce:
Run the test case included in the project and observe the exceptions thrown. You will notice either a CancellationException or a ResourceAccessException occurring randomly.
Expected Behavior:
Consistent behavior with ResourceAccessException thrown during timeout scenarios.
Actual Behavior:
Random exceptions are thrown: either CancellationException or ResourceAccessException.
Please let us know if further information is required.
Thank you.
Regards
The text was updated successfully, but these errors were encountered: