-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[storage] remove dead retry #25455
[storage] remove dead retry #25455
Conversation
…re-sdk-for-python into fix/storage-aiohttp-dependency
API change check API changes are not detected in this pull request. |
currently working on tests. They are only passing when playing live. I think something funky is going on with vcr |
We could also mark the test as live-only. |
Hi @Stevenjin8, thanks for the investigation / explanation about why this retry code is no longer needed. I think you are correct in that the response streaming case does not really come into play here in async since azure-sdk-for-python/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py Line 35 in e789c73
So here we are really only wrapping the calls to For me, I think there is still a question of whether |
Description
This PR is a little different from #25017 and the question is around the retry mechanism in
azure-sdk-for-python/sdk/storage/azure-storage-blob/azure/storage/blob/aio/_download_async.py
Lines 335 to 391 in 33acf79
which was added in #18164. Notably, this retry mechanism catches
ClientPayloadError
. A few months later, #20888 changedAioHttpTransportResponse.load_body
to catchClientPayloadError
's and raise them asIncompleteReadError
. So right now, the retry mechanism isn't doing anything (also when i remove it, all tests pass).So far, this is looking a lot like #25017. But the crucial difference lies in where the body of the response is loaded. In #25017, the body of the response was loaded outside the pipeline in the
process_content
function. For the async clients, the data is loaded inside the pipeline.The pipeline is defined in
azure-sdk-for-python/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/base_client_async.py
Lines 92 to 106 in 33acf79
The
AsyncStorageResponseHook
is afterconfig.retry_policy
. If we look atAsyncStorageResponseHook.send
, we seeazure-sdk-for-python/sdk/storage/azure-storage-blob/azure/storage/blob/_shared/policies_async.py
Line 65 in 33acf79
meaning that the body of the response is loaded later in the pipeline than the retry policy. Thus, if loading the body of the response raises a
IncompleteReadError
, the pipeline will retry the request. If the retry policy runs out of retries, then it will raise aServiceResponseError
.In other words, if we modify the #18164 's retry mechanism to catch
ServiceResponseError
s instead ofaiohttp.ClientPayloadError
s, we would be tripling the number of retries as @jalauzon-msft/@vincenttran-msft suggested earlier.Given that, I think the best way forward is to revert #18164 's retry mechanism because we already have a working retry mechanism and the current code shouldn't ever run.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines