Skip to content

Random CancellationException instead of ResourceAccessException after upgrading to Spring Boot 3.4.0 #33973

Open
@SimonPNorra

Description

@SimonPNorra

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: feedback-providedFeedback has been providedstatus: waiting-for-triageAn issue we've not yet triaged or decided on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions