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

fix: make 'requests.exceptions.ChunkedEncodingError retryable by default #526

Merged
merged 1 commit into from Jul 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions google/cloud/storage/retry.py
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.

import requests
import requests.exceptions as requests_exceptions

from google.api_core import exceptions as api_exceptions
from google.api_core import retry
Expand All @@ -33,6 +34,7 @@
api_exceptions.ServiceUnavailable, # 503
api_exceptions.GatewayTimeout, # 504
requests.ConnectionError,
requests_exceptions.ChunkedEncodingError,
)


Expand Down
6 changes: 6 additions & 0 deletions tests/unit/test_retry.py
Expand Up @@ -69,6 +69,12 @@ def test_w_requests_connection_error(self):
exc = requests.ConnectionError()
self.assertTrue(self._call_fut(exc))

def test_w_requests_chunked_encoding_error(self):
import requests.exceptions

exc = requests.exceptions.ChunkedEncodingError()
self.assertTrue(self._call_fut(exc))

def test_miss_w_stdlib_error(self):
exc = ValueError("testing")
self.assertFalse(self._call_fut(exc))
Expand Down