Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

Commit 96392ec

Browse files
chuyang-dengChuyang Deng
and
Chuyang Deng
authored
fix: increasing max_retry for model availability check (#152)
* fix: increasing max_retry for model availability check * adjust retries max number Co-authored-by: Chuyang Deng <[email protected]>
1 parent 3952606 commit 96392ec

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

docker/build_artifacts/sagemaker/python_service.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import falcon
2222
import requests
2323

24+
from urllib3.util.retry import Retry
25+
2426
from multi_model_utils import lock, timeout, MultiModelException
2527
import tfs_utils
2628

@@ -206,7 +208,11 @@ def _wait_for_model(self, model_name):
206208
while True:
207209
time.sleep(0.5)
208210
try:
209-
response = requests.get(url)
211+
session = requests.Session()
212+
retries = Retry(total=9,
213+
backoff_factor=0.1)
214+
session.mount('http://', requests.adapters.HTTPAdapter(max_retries=retries))
215+
response = session.get(url)
210216
if response.status_code == 200:
211217
versions = json.loads(response.content)['model_version_status']
212218
if all(version["state"] == "AVAILABLE" for version in versions):

0 commit comments

Comments
 (0)