Skip to content

Handle ConnectionResetError in the retry policy of azure.storage.blob #41968

Open
@gdippolito

Description

@gdippolito
  • Package Name: azure-storage-blob
  • Package Version: 12.25.1
  • Operating System: Ubuntu 24.04
  • Python Version: 3.10

Describe the bug

We are getting a few exception while fetching data using the async download_blob function. The exception would look similar to this:

("Response payload is not completed: <ContentLengthError: 400, message='Not enough data for satisfy content length header.'>. ConnectionResetError(104, 'Connection reset by peer')"

while this might happen from time to time I suspect the retry policy is not triggered for such error.

I have seen that in the _shared/policies code we now have some handling code for specific error message.

Do you think we can add this exception in the retry policy?

It is also possible that I'm missing something here. Thanks!

To Reproduce
Steps to reproduce the behavior:

  1. It is hard to reproduce since the exception is raised by a network error.

Expected behavior

I would like ConnectionResetError to be treated as a network error and retried accordingly.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions