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

make aiohttp ClientError retriable #385

Merged
merged 1 commit into from
Apr 30, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion gcsfs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import weakref

from requests.exceptions import RequestException, ProxyError
from aiohttp.client_exceptions import ClientError
from fsspec.asyn import sync_wrapper, sync, AsyncFileSystem
from fsspec.utils import stringify_path, setup_logging
from fsspec.implementations.http import get_client
Expand Down Expand Up @@ -533,7 +534,13 @@ async def _call(
)
self.validate_response(status, contents, path, headers)
break
except (HttpError, RequestException, GoogleAuthError, ChecksumError) as e:
except (
HttpError,
RequestException,
GoogleAuthError,
ChecksumError,
ClientError,
) as e:
if (
isinstance(e, HttpError)
and e.code == 400
Expand Down
2 changes: 2 additions & 0 deletions gcsfs/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import requests.exceptions
import google.auth.exceptions
import aiohttp.client_exceptions


class HttpError(Exception):
Expand Down Expand Up @@ -36,6 +37,7 @@ class ChecksumError(Exception):
requests.exceptions.SSLError,
requests.exceptions.ContentDecodingError,
google.auth.exceptions.RefreshError,
aiohttp.client_exceptions.ClientError,
ChecksumError,
)

Expand Down