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

ExecutionInterceptor access to request attempt exceptions

Open devinsba opened this issue 7 years ago • 3 comments

Maybe this is just a documentation change that is needed but reading through the ExecutionInterceptor comments and traversing through the code I don't see a way to get access to the intermediate exceptions that get retried.

Expected Behavior

ExecutionInterceptor should have a hook like onRequestFailure that would give access to the exception for a specific HTTP request. This would provide the ability to see throttles and other types of events at the request level when it may resolve during the retries.

Current Behavior

The current behavior as I understand it is to add some internal state to the retry handler but to only emit that once the retries have been exhausted.

Possible Solution

Add a new Stage for RequestFailure that the RetryableStage can delegate to for these hooks

Context

When we instrumented the V1 SDK we had the ability to retrieve the intermediate exceptions. With V2 that is not possible at the moment. See https://github.com/openzipkin/zipkin-aws/issues/116 for the corresponding issue on our end.

devinsba avatar Dec 06 '18 13:12 devinsba

I don't believe we have a hook for each individual exception. This sounds like a good idea though. Quick question, for the final exception would you expect it to call this per exception hook in addition to the onExecutionFailure method?

shorea avatar Dec 07 '18 00:12 shorea

I think it would yes. Maybe the exception would state whether the request will be retried, so that we could detect the last request if needed. I don't think it matters to our use case though so just having a hook for the individual http request and exception is enough

devinsba avatar Dec 07 '18 00:12 devinsba

is this still not done? I was getting the exception details with retryCondition and adding them to the executionattributes but this has just been marked deprecated so are we back to no way to get the exceptions?

davidvanlaatum avatar Jun 13 '24 10:06 davidvanlaatum