{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement/issues/25","repository_url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement","labels_url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement/issues/25/comments","events_url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement/issues/25/events","html_url":"https://github.com/Azure/azure-storage-net-data-movement/issues/25","id":137902037,"number":25,"title":"Timeout while DownloadDirectoryAsync is running","user":{"login":"bverhallen","id":7943600,"avatar_url":"https://avatars.githubusercontent.com/u/7943600?v=3","gravatar_id":"","url":"https://api.github.com/users/bverhallen","html_url":"https://github.com/bverhallen","followers_url":"https://api.github.com/users/bverhallen/followers","following_url":"https://api.github.com/users/bverhallen/following{/other_user}","gists_url":"https://api.github.com/users/bverhallen/gists{/gist_id}","starred_url":"https://api.github.com/users/bverhallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bverhallen/subscriptions","organizations_url":"https://api.github.com/users/bverhallen/orgs","repos_url":"https://api.github.com/users/bverhallen/repos","events_url":"https://api.github.com/users/bverhallen/events{/privacy}","received_events_url":"https://api.github.com/users/bverhallen/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-02T15:16:14Z","updated_at":"2016-03-08T09:34:56Z","closed_at":null,"body":"I am trying to get a synchronous blob listing while a large transfer is in progress, using `TransferManager.DownloadDirectoryAsync(...)`\r\n\r\nI am seeing a timeout (StorageException) on the following method:\r\n\r\n`if (container.Exists(requestOptions: new BlobRequestOptions() { MaximumExecutionTime = _defaultTimeout }) == true)\r\n{ /* get listing */ }`\r\n\r\nIt doesn't seem to matter how large the timeout is.\r\nIf no transfer is running, the above code works just fine."},"comment":{"url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement/issues/comments/193688135","html_url":"https://github.com/Azure/azure-storage-net-data-movement/issues/25#issuecomment-193688135","issue_url":"https://api.github.com/repos/Azure/azure-storage-net-data-movement/issues/25","id":193688135,"user":{"login":"bverhallen","id":7943600,"avatar_url":"https://avatars.githubusercontent.com/u/7943600?v=3","gravatar_id":"","url":"https://api.github.com/users/bverhallen","html_url":"https://github.com/bverhallen","followers_url":"https://api.github.com/users/bverhallen/followers","following_url":"https://api.github.com/users/bverhallen/following{/other_user}","gists_url":"https://api.github.com/users/bverhallen/gists{/gist_id}","starred_url":"https://api.github.com/users/bverhallen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bverhallen/subscriptions","organizations_url":"https://api.github.com/users/bverhallen/orgs","repos_url":"https://api.github.com/users/bverhallen/repos","events_url":"https://api.github.com/users/bverhallen/events{/privacy}","received_events_url":"https://api.github.com/users/bverhallen/received_events","type":"User","site_admin":false},"created_at":"2016-03-08T09:34:56Z","updated_at":"2016-03-08T09:34:56Z","body":"To answer your questions:\r\n1. I'm making a graphical UI around an Azure storage account. While it's downloading, it still needs to be responsive, in this case a user is browsing through containers while downloading.\r\n2. Yes, I am consistently seeing a Microsoft.WindowsAzure.Storage.StorageException:\r\nMessage: The operation has timed out.\r\nStack trace:\r\n   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T](RESTCommand`1 cmd, IRetryPolicy policy, OperationContext operationContext)\r\n   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.Exists(Boolean primaryOnly, BlobRequestOptions requestOptions, OperationContext operationContext)\r\n   at Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer.Exists(BlobRequestOptions requestOptions, OperationContext operationContext)\r\n3. It happens on basically everything I do on Azure, it now just happened to be an Exists() check in my listing function. If I remove the check, then I see the same behaviour on blobContainer.ListBlobs()\r\n4. I'm downloading 9 blobs, 49 GB in total, but it seems to occur whenever the size is substantial, i.e. download not completed within seconds.\r\n5. Based on your earlier advice, I have set ServicePointManager.DefaultConnectionLimit = Environment.ProcessorCount * 8;\r\nWithout it, the timeouts re-occur. But with the MaxCountInTransferWindow set to 128 it happens whether ServicePointManager.DefaultConnectionLimit is set or not.\r\nI played around with the MaxCountInTransferWindow value and what I see is the higher its value, the more likely the timeouts are. In my case, when set to 64, timeouts occur, but not always. Keep in mind this is regardless of the timeout value.\r\nThe value of 16 seems to be some kind of sweet spot where I don't see any timeouts.\r\n\r\nI hope this helps!"}}