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] PageBlobWriteStream advances stream position twice during write #14606

Closed
andreaskoepf opened this issue Aug 27, 2020 · 6 comments · Fixed by #14716
Closed

[BUG] PageBlobWriteStream advances stream position twice during write #14606

andreaskoepf opened this issue Aug 27, 2020 · 6 comments · Fixed by #14716
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

@andreaskoepf
Copy link

andreaskoepf commented Aug 27, 2020

Describe the bug
When a write-stream for a CloudPageBlob is created with OpenWrite() and data is written to the StorageWriteStream the stream's position is internally incremented twice. The two additions happen: 1. in the base class StorageWriterStream here and in 2. the derived PageBlobWriteStream here.

Expected behavior
The number of bytes written should be added only to the stream position 1x and not 2x for each write.

What is the actual behavior?
The reported stream position after a write is too high (the offset is added twice, see source code references above).

To Reproduce

  1. Create a PageBlobWriteStream object via CloudPageBlob.OpenWrite()
  2. Read stream's Position property
  3. Write 512 bytes of data into the stream
  4. Read stream's Position property again and observe that it now is 1024 higher than before

Environment:

  • Azure.Storage.Blobs 12.5.1
  • Windows 10, Microsoft.NETCore.App 3.1.7
  • VS 2019 v16.7.2
@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 Aug 27, 2020
@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 Aug 27, 2020
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Aug 27, 2020
@jsquire
Copy link
Member

jsquire commented Aug 27, 2020

Thank you for your feedback. Tagging and routing to the team best able to assist.

@ghost
Copy link

ghost commented Aug 27, 2020

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

@seanmcc-msft
Copy link
Member

Note that this is for the V11 library.

@andreaskoepf
Copy link
Author

@seanmcc-msft You mean V12, don't you? At least the versions of Azure.Storage.Blobs and Azure.Storage.Common that I used to reproduce the bug locally both were 12.5.1 and the source files to which I refer are both part of a commit that was merged 16 days ago.

@seanmcc-msft
Copy link
Member

Yes this is V12, I was confused by the references to CloudPageBlob, which is a class from V11, and not present in V12.

@andreaskoepf
Copy link
Author

@seanmcc-msft sorry for the confusion, I was indeed porting/updating old code to the new sdk. I should have written PageBlobClient of course and not CloudPageBlob...

@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 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. 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

Successfully merging a pull request may close this issue.

3 participants