-
Notifications
You must be signed in to change notification settings - Fork 149
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
What would cause block_blob.download_range_to_stream to generate storage exception with http code = 206 and what to do about it? #203
Comments
According to the REST API documentation, the returned response will return 200, when the full blob is downloaded, and 206 when a part of the blob is downloaded. With this said, if the download range operation returned 206 and is considered an exception, it surely look like a bug. Can you please provide the version of azure-storage-cpp you are using and the OS/compiler? |
Hi Kan, |
We are seeing similar exceptions when reading block blobs when our network is overloaded. azure-storage-cpp logs the below messages when these exceptions are thrown. We're using:
|
Hi @hallca, From our code, the exception of "Incorrect number of bytes received." is a retriable exception, which means if the retry policy allows, the SDK should retry with the request instead of throwing the exception out directly. If it's OK, could you share your code segment for our further investigation? Thanks |
@hallca, I have made a reproduce for this issue. With the default retry policy, it will retry on the error 3 times at most. If it still throws out such exception, might because it cannot complete the request with 3 retries, or the retry policy is changed. If the happens in high frequency in your environment, I think maybe changing the retry policy to have more retries could mitigate this kind of issue. |
Hi,
I have a stresstest which continuously downloads blob objects of the same size (20M) but it very often throws an exception: const azure::storage::storage_exception& with e.result().http_status_code() equals to 206 PARTIAL_CONTENT.
See the code block below:
block_blob.download_range_to_stream(output_stream, offset, download_size, azure::storage::access_condition(), reqOptions, azure::storage::operation_context());
}
catch (const azure::storage::storage_exception& e)
{
//std::cout << U("Error:") << e.what() << std::endl << U("The object can not be downloaded.") << std::endl;
}
The question is whether download_range_to_stream is a synchronous call to make sure the buffer is filled to the requested length and what I should do knowing that the buffer was only partially filled with return code = 206.
What's the best practice here to guarantee my request length is filed?
Thanks,
Yang
The text was updated successfully, but these errors were encountered: