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

[Storage] Revert removing aiohttp dependency for storage.blob.aio #25084

Merged
merged 2 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
### Bugs Fixed
- Stable release of features from 12.13.0b1.
- Added support for deleting versions in `delete_blobs` by supplying `version_id`.
- Removed forced `aiohttp` import from storage async download. (#24965)

## 12.13.0b1 (2022-06-15)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
from typing import AsyncIterator

import asyncio

from azure.core.exceptions import HttpResponseError, ServiceResponseError, IncompleteReadError
from aiohttp import ClientPayloadError
from azure.core.exceptions import HttpResponseError, ServiceResponseError

from .._shared.request_handlers import validate_and_format_range_headers
from .._shared.response_handlers import process_storage_error, parse_length_from_content_range
Expand Down Expand Up @@ -114,15 +114,14 @@ async def _download_chunk(self, chunk_start, chunk_end):
)
retry_active = False

except IncompleteReadError as error:
except HttpResponseError as error:
process_storage_error(error)
except ClientPayloadError as error:
retry_total -= 1
if retry_total <= 0:
raise ServiceResponseError(error, error=error)
await asyncio.sleep(1)

except HttpResponseError as error:
process_storage_error(error)

chunk_data = await process_content(response, offset[0], offset[1], self.encryption_options)


Expand Down Expand Up @@ -357,12 +356,6 @@ async def _initial_request(self):
self.size = self._file_size
retry_active = False

except IncompleteReadError as error:
retry_total -= 1
if retry_total <= 0:
raise ServiceResponseError(error, error=error)
await asyncio.sleep(1)

except HttpResponseError as error:
if self._start_range is None and error.response.status_code == 416:
# Get range will fail on an empty file. If the user did not
Expand All @@ -384,6 +377,12 @@ async def _initial_request(self):
else:
process_storage_error(error)

except ClientPayloadError as error:
retry_total -= 1
if retry_total <= 0:
raise ServiceResponseError(error, error=error)
await asyncio.sleep(1)

# get page ranges to optimize downloading sparse page blob
if response.properties.blob_type == 'PageBlob':
try:
Expand Down