Skip to content
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

IMDS returns SdkClientException on 4XX errors, but reading autoscaling lifecycle state can return 404. #5786

Open
2 tasks done
benjumanji opened this issue Jan 9, 2025 · 0 comments
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@benjumanji
Copy link

benjumanji commented Jan 9, 2025

Describe the feature

IMDS client should return SdkServiceException when an http request is returned from the service. It's use of SdkClientException doesn't match the description in the docs: https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/handling-exceptions.html#sdkclientexception, to wit:

An SdkClientException is generally more severe than an SdkServiceException, and indicates a major problem that is preventing the client from making service calls to AWS services

A request that recieves a response cannot be a client exception. It made the call, the service rejected it.

Use Case

IMDS client returns SdkClientExceptions unconditionally on 4XX errors (

throw SdkClientException.builder().message(responseContent).build();
) but when an instance has been up for some length of time then reading the autoscaling lifecycle state can fail with a 404, this is not a client error and is retryable. We don't want to log these, but the status code isn't accessible to us because the client threw away that information.

Proposed Solution

Return an SdkServiceException any time there is an actual service response.

Other Information

No response

Acknowledgements

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

AWS Java SDK version used

2

JDK version used

17

Operating System and version

linux 6.11 (nixos)

@benjumanji benjumanji added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

1 participant