Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE REQ] OpenRead for BlockBlob should return properties #41697

Closed
jbayardo opened this issue Feb 1, 2024 · 2 comments
Closed

[FEATURE REQ] OpenRead for BlockBlob should return properties #41697

jbayardo opened this issue Feb 1, 2024 · 2 comments
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)

Comments

@jbayardo
Copy link

jbayardo commented Feb 1, 2024

Library name

Azure.Storage.Blobs

Please describe the feature.

There's currently 2 families of methods to download blobs OpenRead and DownloadStreaming. As per #22022 , the former is better for chunked downloads (because the connection is returned to the connection pool), and the latter is better for quick usages (because the pool is held for the lifetime of the stream).

Both families of methods do a GetProperties call as their first order of business as part of determining how to chunk the download, and potentially upon reaching the end of the stream if concurrent modifications are allowed. They also use this information for client-side encryption.

This is already (in my opinion) not ideal because the initial transfer size is part of the options that are passed in, so it should be possible to start with a range download except for cases where client side encryption is enabled. Nevertheless, that's not the focus of this feature request.

The DownloadStreaming family of methods returns the properties it fetches as part of the object, so downstream client code can use these for whatever purposes the client may intend. The OpenRead family of methods doesn't.

The problem with this is it leaves clients with bad options if they need to use the properties:

  • Do an extra API call on top of the already "unnecessary" GetProperties that the SDK already does to obtain the properties beforehand and determine what needs to be done.
  • Call DownloadStreaming, which doesn't do chunking and forces you to implement your own.

Ideally, OpenRead would return the properties that it's fetching as it's first order of business instead, which would allow downstream clients to rely on those. Even more ideally, none of these methods would call GetProperties unless they truly need to (for ex: in client side encryption).

@github-actions github-actions bot added Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-triage Workflow: This issue needs the team to triage. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files) labels Feb 1, 2024
@jsquire jsquire added Service Attention Workflow: This issue is responsible by Azure service team. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team and removed needs-team-triage Workflow: This issue needs the team to triage. labels Feb 1, 2024
Copy link

github-actions bot commented Feb 1, 2024

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage.

@seanmcc-msft
Copy link
Member

@jbayardo, the initial GetProperties() call exists so that we can fail fast if the underlying blob does not exist in the service, and so we can obtain the Etag of the blob in question, in case the customer is using allowModifiations == false.

We are not allowed to have breaking changes in the Storage SDK. Today, OpenRead() returns a stream, and changing the return type for an existing API is considered a breaking change.

DownloadStream() returns a Response. You can access the blob properties with BlobDownloadStreamingResult.Details.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 20, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

3 participants