aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

map AWS_IO_SOCKET_TIMEOUT to java's SocketTimeoutException

Open thomasjinlo opened this issue 1 year ago • 1 comments

Describe the feature

Context

AwsCrtHttpClient returns a generic HttpException that requires looking at the error message to understand the type of error. This is different than ApacheHttpClient which returns specific exception subclassing IOException.

Problem

Use Case

We are upgrading from V1 to V2, and moving from ApacheHttpClient to CrtHttpClient and would like to keep the same functionality on retrying on connection and socket timeouts specifically.

Proposed Solution

On connection failures map AWS_IO_SOCKET_TIMEOUT (ETIMEDOUT) error code to SocketTimeoutException. We are already doing something similar with AWS_IO_TLS_ERROR_NEGOTIATION_FAILURE to SSLHandshakeException.

https://github.com/aws/aws-sdk-java-v2/blob/master/http-clients/aws-crt-client/src/main/java/software/amazon/awssdk/http/crt/internal/CrtUtils.java#L58-L60

Other Information

No response

Acknowledgements

  • [x] I may be able to implement this feature request
  • [ ] This feature might incur a breaking change

AWS Java SDK version used

2.x

JDK version used

openjdk 17.0.14 2025-01-21 LTS

Operating System and version

AL2

thomasjinlo avatar Mar 08 '25 00:03 thomasjinlo

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.

github-actions[bot] avatar Mar 13 '25 23:03 github-actions[bot]