Azure / azure-storage-python

Microsoft Azure Storage Library for Python
https://azure-storage.readthedocs.io
MIT License
338 stars 240 forks source link

_download_chunking.py: avoid to overwrite if_match #630

Closed marco-rossi29 closed 4 years ago

marco-rossi29 commented 4 years ago

Solve issue #625

marco-rossi29 commented 4 years ago

@zezha-msft let me know if this is acceptable

zezha-msft commented 4 years ago

Hi @marco-rossi29, sorry for the delayed reply! And thanks for contributing!

The current design has one problem: because of this line, self.if_match is never None.

In addition, when self.if_match is indeed None (which never happens right now) and we are downloading the blob in parallel chunks, then there's a data race to set its value. I propose to simply remove this line and the comments above it , as it's redundant and not needed.

Please let me know if you'd like to do that. Otherwise I can do it too. Thank you!

marco-rossi29 commented 4 years ago

No problem, thank you for responding! Yes, that's perfect for me. I removed it.

I see that you changed the base from master to dev and now there are some spurious changes. Do you want me to remove such changes from my PR by rebasing my two commits on top of 54e60c8?

zezha-msft commented 4 years ago

@marco-rossi29 no it's ok, we had to pull back the changes from master into dev anyways. Thanks!