Skip to content
Merged
Changes from 1 commit
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
7 changes: 6 additions & 1 deletion src/datasets/utils/file_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,12 @@ def read_with_retries(*args, **kwargs):
try:
out = read(*args, **kwargs)
break
except (ClientError, TimeoutError) as err:
except (
ClientError,
TimeoutError,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) Those two correspond to aiohttp.client_exceptions.ClientError and asyncio.TimeoutError. I think it's best to explicitly name them as you did with requests.exceptions.ConnectTimeout. It was not obvious for me at first (I wondered what was the difference between those 4 only to figure out it was not only requests errors)

requests.exceptions.ConnectTimeout,
requests.exceptions.ConnectionError,
) as err:
disconnect_err = err
logger.warning(
f"Got disconnected from remote data host. Retrying in {config.STREAMING_READ_RETRY_INTERVAL}sec [{retry}/{max_retries}]"
Expand Down