Azure / Azure/azure-storage-python

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

Abierto
#625 7 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
343
Forks
243
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

### 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='*')
```

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Comience en BlockBlobService.get_blob_to_path() y ejecute la reproducción proporcionada de la descarga de 100 MiB con if_match='*' mientras se escribe en el append blob. Compare el comportamiento entre las versiones del SDK indicadas; se considera completado cuando la descarga ya no se bloquea con ConditionNotMet bajo las condiciones indicadas y existe cobertura de regresión para la reproducción.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
azure, python
Área
cloud
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.