Skip to content

Commit 3cb30fb

Browse files
authored
Fix Client doesn't recover from remote connection resets (#2129)
1 parent 6c2db04 commit 3cb30fb

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

examples/nlp-case/run.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
@click.option(
6868
"--no-cache",
6969
is_flag=True,
70-
default=False,
70+
default=True,
7171
help="Disable caching for the pipeline run.",
7272
)
7373
@click.option(

src/zenml/zen_stores/rest_zen_store.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
import requests
3333
import urllib3
3434
from pydantic import BaseModel, root_validator, validator
35+
from requests.adapters import HTTPAdapter, Retry
3536

3637
import zenml
3738
from zenml.analytics import source_context
@@ -3183,6 +3184,9 @@ def session(self) -> requests.Session:
31833184
)
31843185

31853186
self._session = requests.Session()
3187+
retries = Retry(backoff_factor=0.1, connect=5)
3188+
self._session.mount("https://", HTTPAdapter(max_retries=retries))
3189+
self._session.mount("http://", HTTPAdapter(max_retries=retries))
31863190
self._session.verify = self.config.verify_ssl
31873191
token = self._get_auth_token()
31883192
self._session.headers.update({"Authorization": "Bearer " + token})

0 commit comments

Comments
 (0)