Skip to content

Commit

Permalink
fix: retry if upload fails with requests.exceptions.ConnectionError [D…
Browse files Browse the repository at this point in the history
  • Loading branch information
eecsliu authored Jun 30, 2020
1 parent 7aea74c commit ad61ccd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion common/determined_common/storage/gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
import tempfile
from typing import Iterator, Optional

import requests.exceptions
import urllib3.exceptions
from google.api_core import retry
from google.cloud import storage

from determined_common.storage.base import StorageManager, StorageMetadata

retry_network_errors = retry.Retry(
retry.if_exception_type(ConnectionError, urllib3.exceptions.ProtocolError)
retry.if_exception_type(
ConnectionError, urllib3.exceptions.ProtocolError, requests.exceptions.ConnectionError
)
)


Expand Down

0 comments on commit ad61ccd

Please sign in to comment.