Skip to content

Commit

Permalink
make aiohttp ClientError retriable (#385)
Browse files Browse the repository at this point in the history
  • Loading branch information
slevang authored Apr 30, 2021
1 parent 60be1b9 commit b792f65
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
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

0 comments on commit b792f65

Please sign in to comment.