6

我正在使用 Azure 存储,在容器上调用命令时遇到了一些问题。我通过单元测试运行它,有时当在容器上调用命令时,它只是坐下来等待该命令近 5 分钟。如果我等待足够长的时间,它将继续并成功。运行它时,容器确实存在,因此根本不必创建容器。

有没有其他人遇到过这个问题?我尝试设置 a ServerTimeoutBlobRequestOptions但没有任何影响。

这是我的代码正在执行的操作的示例:

var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference(containerName);
var options = new BlobRequestOptions() { ServerTimeout = TimeSpan.FromSeconds(10) };
if (!container.Exists(options)) //<<<<this is where it hangs
{
    container.Create();
}

我也试过了CreateIfNotExists()

var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference(containerName);
container.CreateIfNotExists(); //<<<this is where it hangs

如果我只是尝试列出 blob,它也会挂起

var blobClient = _storageAccount.CreateCloudBlobClient();
var container = blobClient.GetContainerReference(containerName);
container.ListBlobs(); //<<<<this is where it hangs

它不会发生在每个容器上,但是当它发生在一个容器上时,它似乎是同一个容器。我已经检查过,容器确实存在。

4

2 回答 2

0

我报告了一个非常相似的情况:Checking if item exists in Azure blob container takes forever (SDK 2.0)。还没有找到答案。

于 2013-05-22T19:31:46.603 回答
-2

你能把 Fiddler 挂到设置中,看看是否有任何有意义的信息出来吗?(有关设置,请参见http://sepialabs.com/blog/2012/02/17/profiling-azure-storage-with-fiddler/ )

如果没有,我建议联系支持人员。

于 2013-03-13T07:06:04.477 回答