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

[BUG] Missing deserialization of LeaseStatus in Azure.Storage.Blobs.BlobExtensions.ToBlobDownloadStreamingResult #22144

Closed
egraff opened this issue Jun 24, 2021 · 3 comments · Fixed by #22306
Assignees
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. Functions 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

@egraff
Copy link

egraff commented Jun 24, 2021

Describe the bug
Azure.Storage.Blobs.BlobExtensions.ToBlobDownloadStreamingResult() does not populate the BlobDownloadDetails's LeaseState from the response headers object. It does set the LeaseState and LeaseDuration:

LeaseDuration = response.Headers.LeaseDuration ?? LeaseDurationType.Infinite,
LeaseState = response.Headers.LeaseState.GetValueOrDefault(),

but is missing something like:

LeaseStatus = response.Headers.LeaseStatus.GetValueOrDefault()

This is a regression introduced in 1814567.

As a result of this, the BlobDownloadDetails you get after doing e.g. BlobBaseClient.DownloadAsync() returns a LeaseStatus that is always equal to LeaseStatus.Locked (since this is the default value of the enum).

Expected behavior
The BlobDownloadDetails should contain a LeaseStatus that reflects the value of the x-ms-lease-status header from the "Get Blob" HTTP response.

Actual behavior (include Exception or Stack Trace)
BlobDownloadDetails always contains a LeaseStatus equal to LeaseStatus.Locked.

To Reproduce

/* Pseudo-code */
BaseBlobClient blobClient = GetClientForUnlockedBlob();
Response<BlobDownloadInfo> downloadResponse = await blobClient.DownloadAsync().ConfigureAwait(false);
Assert.That(downloadResponse.Value.Details.LeaseStatus, Is.EqualTo(LeaseStatus.Unlocked));

Environment:

  • Name and version of the Library package used: Azure.Storage.Blobs 12.9.0 (issue is not present in Azure.Storage.Blobs 12.8.4)
@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jun 24, 2021
@jsquire jsquire added Client This issue points to a problem in the data-plane of the library. needs-team-attention Workflow: This issue needs attention from Azure service team or SDK team Service Attention Workflow: This issue is responsible by Azure service team. Storage Storage Service (Queues, Blobs, Files) labels Jun 24, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jun 24, 2021
@ghost
Copy link

ghost commented Jun 24, 2021

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

Issue Details

Describe the bug
Azure.Storage.Blobs.BlobExtensions.ToBlobDownloadStreamingResult() does not populate the BlobDownloadDetails's LeaseState from the response headers object. It does set the LeaseState and LeaseDuration:

LeaseDuration = response.Headers.LeaseDuration ?? LeaseDurationType.Infinite,
LeaseState = response.Headers.LeaseState.GetValueOrDefault(),

but is missing something like:

LeaseStatus = response.Headers.LeaseStatus.GetValueOrDefault()

This is a regression introduced in 1814567.

As a result of this, the BlobDownloadDetails you get after doing e.g. BlobBaseClient.DownloadAsync() returns a LeaseStatus that is always equal to LeaseStatus.Locked (since this is the default value of the enum).

Expected behavior
The BlobDownloadDetails should contain a LeaseStatus that reflects the value of the x-ms-lease-status header from the "Get Blob" HTTP response.

Actual behavior (include Exception or Stack Trace)
BlobDownloadDetails always contains a LeaseStatus equal to LeaseStatus.Locked.

To Reproduce

/* Pseudo-code */
BaseBlobClient blobClient = GetClientForUnlockedBlob();
Response<BlobDownloadInfo> downloadResponse = await blobClient.DownloadAsync().ConfigureAwait(false);
Assert.That(downloadResponse.Value.Details.LeaseStatus, Is.EqualTo(LeaseStatus.Unlocked));

Environment:

  • Name and version of the Library package used: Azure.Storage.Blobs 12.9.0 (issue is not present in Azure.Storage.Blobs 12.8.4)
Author: egraff
Assignees: -
Labels:

Client, Service Attention, Storage, customer-reported, needs-team-attention, needs-triage, question

Milestone: -

@amishra-dev
Copy link
Contributor

@seanmcc-msft Sean, could you please look at this one.

@seanmcc-msft
Copy link
Member

Hi @egraff, I can repo this issue, and will work to address it shortly.

Thanks for reporting this!

-Sean

azure-sdk pushed a commit to azure-sdk/azure-sdk-for-net that referenced this issue Jan 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
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. Functions 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
4 participants