-
Notifications
You must be signed in to change notification settings - Fork 370
DownloadToStream hangs indefinitely on network error #790
Comments
I also see this behavior for other methods, like PutBlock or UploadFromStream on .Net Core 2.1 on a Linux VM. I don't see this behavior on a linux container on Docker for Windows. |
Any update on this? Here is some more info I've found;
The following code fails 100% of the time if the network is changed during the call. static void Main(string[] args)
{
try
{
CloudStorageAccount.TryParse("<Connection String>", out var storageAccount);
var cloudBlobClient = storageAccount.CreateCloudBlobClient();
var container = cloudBlobClient.GetContainerReference("<Container Reference>");
var blobRef = container.GetBlockBlobReference("Large Text.txt");
Stream memoryStream = new MemoryStream();
BlobRequestOptions optionsWithRetryPolicy = new BlobRequestOptions() { ServerTimeout = TimeSpan.FromSeconds(5), RetryPolicy = new LinearRetry(TimeSpan.FromSeconds(20), 4) };
blobRef.DownloadToStreamAsync(memoryStream, null, optionsWithRetryPolicy, null).GetAwaiter().GetResult();
Console.WriteLine("Completed");
}
catch (Exception ex)
{
Console.WriteLine($"Exception: {ex.Message}");
}
finally
{
Console.WriteLine("Finished");
}
} |
This makes some of our scenarios extremely difficult right now, Especially cross region downloads. Some of our machines are on WUS2 (GPU) and some of our storage is on WUS. Apparently there are known networking issues between the two, leading to a lot of storage stalls because of this issue. |
Thanks for getting back so quickly! The storage account I was using for testing this issue at first was East US paired with West US. I've just tried it again using UK South paired with UK West and had the exact same problem. I also created a Locally Redundant Storage Account in North Europe and it also hangs indefinitely so I'm not sure it's to do with cross Data Center networking |
Oh, I agree; I just meant that in our case it just made the errors a lot more likely to hang due to networking issues. (without forcing networking issues like pulling a cable, etc) |
I am seeing the same behaviour with CloudFile.DownloadToFileAsync and CloudFile.UploadFromFileAsync. Disconnecting/reconnecting the network fails to resume the operation. The operation hangs forever and ServerTimeout is ignored. The operations do respect the cancellation token.
|
Hey dtotzke, that's the exact same as what I found, so I wrote some code in order to monitor the stream for activity in my stackoverflow question and cancel the request if the download stalls. The code hasn't been battle tested yet but thanks to Mohit for the idea. |
Thanks @ConnorDickson . I'm using the overload that accepts a
|
Fixed in 11.1.4 version |
Which service(blob, file, queue, table) does this issue concern?
Blob
Which version of the SDK was used?
9.3.2
Which platform are you using? (ex: .NET Core 2.1)
.NET Framework 4.5.2
What problem was encountered?
If I disconnect the network cable while calling DownloadToStream, the client hangs indefinitely.
How can we reproduce the problem in the simplest way?
This causes the client to hang every time I try it (I've waited 30 minutes). I have not set any default timeouts on the blob client object (using DefaultRequestOptions).
Have you found a mitigation/solution?
Specifying MaximumExecutionTime in the BlobRequestOptions works, but it seems incorrect that the default behavior of the client would be to hang indefinitely.
I was expecting either a default built-in per-request timeout, or being forced to specify a timeout myself. Defaulting to hanging indefinitely seems like a bug.
Maybe I'm missing something?
The text was updated successfully, but these errors were encountered: