Repository navigation
fix: make local mode health-check timeout configurable via session config - #5778
mohamedzeidan2021 merged 2 commits into
Conversation
…nfig (aws#3362) Allow users to set `local.health_check_timeout` in their session config to override the hard-coded 120s limit, fixing failures when large model archives or slow networks cause container startup to exceed the default. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @mohamedzeidan2021's task in 44s —— View job Code Review — Local mode health-check timeout
Thanks for the fix — this is a clean, well-scoped change that addresses #3362. It mirrors the existing Correctness / backwards-compat: ✅ Default preserved, public signature extended with a keyword-only-by-convention arg, both call sites updated. No config schema needed updating (local config keys aren't validated against a schema). A few minor, non-blocking observations: 1.
health_check_timeout = (
get_config_value("local.health_check_timeout", self.local_session.config)
or HEALTH_CHECK_TIMEOUT_LIMIT
)If a user sets 2. No type coercion on the config value (low severity) The value flows straight into 3. Misleading comment in
# With timeout=10 and step=5, only 2 iterations before i(=10) >= timeout(=10)
assert mock_perform_request.call_count == 1The assertion ( Optional: consider adding a short note about the new Nothing here blocks merge — the core logic and tests are solid. 👍 |
|
Thanks for this — a couple of things to sort out before it can go in. The config key isn't accepted by the local-mode schema. jsonschema.validate({"local": {"health_check_timeout": 600}},
SAGEMAKER_PYTHON_SDK_LOCAL_MODE_CONFIG_SCHEMA)
# ValidationError: Additional properties are not allowed ('health_check_timeout' was unexpected)The new tests don't catch this because they assign Two smaller test notes:
On CI: none of the unit or integ failures come from this change.
|
Problem
Local mode endpoint deployment uses a hard-coded
HEALTH_CHECK_TIMEOUT_LIMITof 120s (entities.py:43). This causes failures when containers take longer to start — e.g. large model archives (~5GB+), slow pip installs, or low-bandwidth environments — even though the actual SageMaker endpoint deployment succeeds fine.Fixes #3362.
Solution
timeoutparameter to_wait_for_serving_container()(defaults toHEALTH_CHECK_TIMEOUT_LIMITfor backwards compatibility)_LocalEndpoint.serve()and_LocalTransformJob.start()now readlocal.health_check_timeoutfrom the session config and pass it throughUsage:
Testing
Added unit tests covering:
_wait_for_serving_containerhealth_check_timeoutfrom session config is passed through in_LocalEndpoint.serve()Checklist