-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Fix smithy client retry handling #3160
Conversation
dcaed4c
to
9204992
Compare
pRequestCtx->m_endpoint.GetAttributes()->authScheme.GetSigningRegion().value() : ""; | ||
const Aws::String signerRegion = [&]() { | ||
if (!regionFromResponse.empty() && | ||
pRequestCtx->m_endpoint.GetAttributes() && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the problem here was that lack of the check for an Optional pRequestCtx->m_endpoint.GetAttributes()
which is not always set.
AWS_LOGSTREAM_DEBUG(AWS_SMITHY_CLIENT_LOG, "Request returned error. Attempting to generate appropriate error codes from response"); | ||
assert(m_errorMarshaller); | ||
auto error = m_errorMarshaller->BuildAWSError(httpResponse); | ||
return HttpResponseOutcome(std::move(error)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the main diff here is to not perform early return
return pRequestCtx->m_responseHandler(HttpResponseOutcome(std::move(error)));
but I also used IIFE to avoid modification of the other blocks by keeping the original variable Aws::Client::HttpResponseOutcome outcome
9204992
to
8be9734
Compare
8be9734
to
9310e6e
Compare
Issue #, if available:
The retry handling was broken on the smithy request pipeline
Description of changes:
Do no immediately call the response handler in case of error, go through retry loop first
Check all that applies:
Check which platforms you have built SDK on to verify the correctness of this PR.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.