You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using BlobClient together with storage account keys. When issuing a request to the API (e.g. get_properties for a blob), the program hangs for ~80 seconds if a non-existing account name was provided.
Reproducer
This assumes you have tokio, azure_storage and azure_storage_blobs available to your crate.
use std::time::Instant;use azure_storage::StorageCredentials;use azure_storage_blobs::prelude::{BlobClient,BlobServiceClient};fnmain(){let account = "this-account-does-not-exist-1234";// The provided key is a real one, but has been invalidated for securitylet credentials = StorageCredentials::access_key(account,"7+iu4f92PM6yp0RcMMpRFxMHImIPNaqrxkXNVUoqZZVfdRwgXFTQYPbuUIukX8L+lqmSlVNXFB0/+AStcAn91g==");let client = BlobServiceClient::new(account, credentials).container_client("my-container").blob_client("my-blob");let rt = tokio::runtime::Builder::new_current_thread().enable_all().build().unwrap();
rt.block_on(get_properties(client));}asyncfnget_properties(client:BlobClient){let start = Instant::now();println!("Start streaming");let blob_stream = client.get_properties().await;println!("Done streaming after {:.2} seconds: success = {}", start.elapsed().as_secs_f64(), blob_stream.is_ok());}
Probable cause
Behind the scenes, the client uses the account name to build the API url when issuing a specific request (e.g. GETting a blog would go to https://<my-account>.blob.core.windows.net/<container-name>/<blob-path>). I assume the DNS resolver hangs for some reason, instead of giving up quickly.
Suggested solution
Ensure the request times out earlier. If the problem lies indeed in DNS resolving, maybe we should give up after 5 seconds.
The text was updated successfully, but these errors were encountered:
Problem description
I'm using
BlobClient
together with storage account keys. When issuing a request to the API (e.g.get_properties
for a blob), the program hangs for ~80 seconds if a non-existing account name was provided.Reproducer
This assumes you have
tokio
,azure_storage
andazure_storage_blobs
available to your crate.Probable cause
Behind the scenes, the client uses the account name to build the API url when issuing a specific request (e.g. GETting a blog would go to
https://<my-account>.blob.core.windows.net/<container-name>/<blob-path>
). I assume the DNS resolver hangs for some reason, instead of giving up quickly.Suggested solution
Ensure the request times out earlier. If the problem lies indeed in DNS resolving, maybe we should give up after 5 seconds.
The text was updated successfully, but these errors were encountered: