Skip to content

Conversation

@tasherif-msft
Copy link
Contributor

Blobs:
Currently in blobs we lock on etag, and we try to let the user override this by passing If-Match:'*' but the logic was incorrect which just led to the ability to modify a blob during the second chunked call, otherwise it would still fail. I have removed this extra logic completely.

Fileshare:
Added locking on etag - previously there was no etag locking.

@ghost ghost added the Storage Storage Service (Queues, Blobs, Files) label Jun 16, 2021
@tasherif-msft tasherif-msft changed the title Ensured that download fails if blob/file modified mid download [Blob][Fileshare] Ensured that download fails if blob/file modified mid download Jun 16, 2021
Copy link
Contributor

@kasobol-msft kasobol-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

**self.request_options
)
if response.properties.etag != self.etag:
raise ValueError("The file has been modified while downloading.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check with @annatisch if this is right exception type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In dotnet we throw this and provide more data than just message.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed with @xiafu-msft and we are now throwing ResourceModifiedError as per blob natively does in this case.

@tasherif-msft tasherif-msft merged commit af456fe into Azure:main Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants