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

[Blob][Fileshare] Ensured that download fails if blob/file modified mid download #19276

Merged
merged 4 commits into from
Jun 29, 2021
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
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,8 @@ def _initial_request(self):
# If the file is small, the download is complete at this point.
# If file size is large, download the rest of the file in chunks.
if response.properties.size != self.size:
# Lock on the etag. This can be overriden by the user by specifying '*'
if self._request_options.get("modified_access_conditions"):
if not self._request_options["modified_access_conditions"].if_match:
self._request_options["modified_access_conditions"].if_match = response.properties.etag
self._request_options["modified_access_conditions"].if_match = response.properties.etag
else:
self._download_complete = True
return response
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,8 @@ async def _initial_request(self):
# If the file is small, the download is complete at this point.
# If file size is large, download the rest of the file in chunks.
if response.properties.size != self.size:
# Lock on the etag. This can be overriden by the user by specifying '*'
if self._request_options.get('modified_access_conditions'):
if not self._request_options['modified_access_conditions'].if_match:
self._request_options['modified_access_conditions'].if_match = response.properties.etag
self._request_options['modified_access_conditions'].if_match = response.properties.etag
else:
self._download_complete = True
return response
Expand Down
Loading