Azure / Azure/azure-storage-python

BlockBlobService.get_blob_to_path() crashes even when if_match='*'

オープン
#625 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
343
フォーク
243
PR マージ指標
30日以内にマージされた PR はありません

説明

### Which service(blob, file, queue) does this issue concern?
BlockBlobService.get_blob_to_path()

### Which version of the SDK was used? Please provide the output of `pip freeze`.
Same issue is encountered in versions: 0.37.1, 1.3.0, and 2.1.0

**Version 0.37.1**
>pip freeze
azure-common==1.1.8
azure-nspkg==2.0.0
azure-storage==0.36.0
azure-storage-blob==0.37.1
azure-storage-common==0.37.1
azure-storage-nspkg==2.0.0

**Version 1.3.0**
>pip freeze
azure-common==1.1.8
azure-nspkg==2.0.0
azure-storage==0.36.0
azure-storage-blob==1.3.0
azure-storage-common==1.3.0
azure-storage-nspkg==2.0.0

**Latest version**
>pip freeze
azure-common==1.1.8
azure-nspkg==2.0.0
azure-storage==0.36.0
azure-storage-blob==2.1.0
azure-storage-common==2.1.0
azure-storage-nspkg==2.0.0

### What problem was encountered?
When trying to download a blob that is currently been written in append mode (i.e., the ETag changes during time of download), `BlockBlobService.get_blob_to_path()` crashes even when using `if_match='*'` giving **ConditionNotMet** Error:
`Client-Request-ID=9cce10c8-b739-11e9-9366-b32a86ae676b Retry policy did not allow for a retry: Server-Timestamp=Mon, 05 Aug 2019 04:29:28 GMT, Server-Request-ID=86bb1780-a01e-002e-6146-4b01e3000000, HTTP status code=412, Exception=The condition specified using HTTP conditional header(s) is not met. ErrorCode: ConditionNotMetConditionNotMetThe condition specified using HTTP conditional header(s) is not met.RequestId:86bb1780-a01e-002e-6146-4b01e3000000Time:2019-08-05T04:29:28.3320963Z`

### Have you found a mitigation/solution?
- Using a version before **1.3.1** and using `max_connections=1` mitigates the problem
- Downloading a very small portion of the blob (< 20 MB) will work since ETag doesn't change during time of download

Code to repro:
```
bbs = BlockBlobService(connection_string=connection_string)
bbs.get_blob_to_path(app_id, blob_name, output_fp, start_range=0, end_range=100*1024**2, if_match='*')
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start at BlockBlobService.get_blob_to_path() and run the supplied 100 MiB download reproduction with if_match='*' while the append blob is being written. Compare the behavior across the listed SDK versions; done means the download no longer crashes with ConditionNotMet under the stated conditions, with regression coverage for the reproduction.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
azure, python
領域
cloud
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。