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

Commit 596a03b

Browse files
committed
Add env var that will manage GUnicorn setup timeout.
1 parent e8bd2be commit 596a03b

File tree

1 file changed

+4
-1
lines changed
  • docker/build_artifacts/sagemaker

1 file changed

+4
-1
lines changed

docker/build_artifacts/sagemaker/serve.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ def __init__(self):
6363
self._tfs_inter_op_parallelism = os.environ.get("SAGEMAKER_TFS_INTER_OP_PARALLELISM", 0)
6464
self._tfs_intra_op_parallelism = os.environ.get("SAGEMAKER_TFS_INTRA_OP_PARALLELISM", 0)
6565
self._gunicorn_worker_class = os.environ.get("SAGEMAKER_GUNICORN_WORKER_CLASS", "gevent")
66+
self._gunicorn_setup_timeout_seconds = os.environ.get(
67+
"SAGEMAKER_GUNICORN_SETUP_TIMEOUT_SECONDS", 30
68+
)
6669

6770
if os.environ.get("OMP_NUM_THREADS") is None:
6871
os.environ["OMP_NUM_THREADS"] = "1"
@@ -449,7 +452,7 @@ def start(self):
449452
self._setup_gunicorn()
450453
self._start_gunicorn()
451454
# make sure gunicorn is up
452-
with self._timeout(seconds=30):
455+
with self._timeout(seconds=self._gunicorn_setup_timeout_seconds):
453456
self._wait_for_gunicorn()
454457

455458
self._start_nginx()

0 commit comments

Comments
 (0)