Azure / azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
MIT License
2.09k stars 1.2k forks source link

Non integer blockSize causing byte(s) to be omitted from uploaded blobs. #31763

Open willavos opened 20 hours ago

willavos commented 20 hours ago

Describe the bug A non-integer blockSize in BlockBlobClient.uploadData causes bytes to be omitted (on chunk boundaries?) in the uploaded file. I suspect this is a rounding error!

To Reproduce Steps to reproduce the behavior:

  1. Create a file with 1637734 bytes long:
    • cat /dev/random | head -c 1637734 > test-file
  2. Try and upload 20 chunks, (blockSize = file size / 20 which is 81886.7)
  3. Observe a missing byte halfway through.

Expected behavior To not omit the byte.

Screenshots N/A

Additional context I appreciate that this is a case of GIGO - but believe there should be a warming (at least) for poorly-conditioned blob block size / this should not result in missing byte.

github-actions[bot] commented 20 hours ago

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