sirdank
sirdank

Reputation: 3571

Why does it take 100 seconds to delete a blob?

I have code like this

BlobDownloadInfo blob = Client.GetBlockBlobClient(filePath).Download().Value;
...
Client.GetBlockBlobClient(filePath).DeleteIfExists();

And DeleteIfExists() reliably takes 00:01:42 (about 100 seconds) to delete my blob. Why?

Upvotes: 0

Views: 291

Answers (1)

sirdank
sirdank

Reputation: 3571

BlobDownloadInfo is an IDisposable. By not disposing it, we appear to be keeping open the connection and forcing DeleteIfExists() to wait for that connection to timeout. Updating the code to

using (BlobDownloadInfo blob = Client.GetBlockBlobClient(filePath).Download().Value)

causes DeleteIfExists() to return in about 00:00:00.15

Upvotes: 2

Related Questions