[BUG] BlobClient.DownloadTo does not download data using parallel requests #49241
Labels
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
needs-team-attention
Workflow: This issue needs attention from Azure service team or SDK team
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Service Attention
Workflow: This issue is responsible by Azure service team.
Storage
Storage Service (Queues, Blobs, Files)
Library name and version
Azure.Storage.Blobs 12.24.0
Describe the bug
According to the documentation,
DownloadTo(Stream)
should download a blob using parallel requests. This does not work. Instead of downloading parts of the blob in parallel, it downloads the parts one at a time sequentially.If I use the
DownloadToAsync
function instead, parallel downloads are performed.I am not familiar with the Azure.Storage.Blobs code-base, but it looks like
DownloadTo
callsStagedDownloadAsync
, passing inasync
=false
. The value is passed on toPartitionedDownloader.DownloadToInternal
which contains the following line:effectiveWorkerCount
is later on used to control the number of parallel tasks.Expected behavior
When downloading a blob which is 350 MB large, I expect multiple HTTP-requests to be sent in parallel (since the documentation mentions that the function "downloads a blob using parallel requests").
Actual behavior
The following happens:
(255MB appears to be the default value for
StorageTransferOptions.InitialTransferSize
)These downloads happens sequentially and not in parallel.
Reproduction Steps
According to the documentation, data should be downloaded in parallel but that does not happen. The data in the blob is downloaded sequentially.
Even if I explicitly set concurrency, download does not happen in parallel.
If I change the code to the following, downloads will happen in parallel.
Environment
Windows 11, Visual Studio 2022, .NET Framework 4.8
The text was updated successfully, but these errors were encountered: