Skip to content

fix(serve): honor container_timeout_seconds in LocalContainerMode.create_server - #6432

Open
AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/local-container-mode-timeout
Open

AkshayShah03 wants to merge 1 commit into
aws:masterfrom
AkshayShah03:fix/local-container-mode-timeout

Conversation

@AkshayShah03

Copy link
Copy Markdown

Issue #, if available: N/A

Description of changes:

LocalContainerMode.create_server overwrote its container_timeout_seconds argument before computing the health-check deadline:

log_generator = self.container.logs(follow=True, stream=True)
container_timeout_seconds = 1200
time_limit = datetime.now() + timedelta(seconds=container_timeout_seconds)

ModelBuilder.deploy(container_timeout_in_seconds=N) in LOCAL_CONTAINER mode passes N down to create_server, but the value was ignored:

  • a short timeout still blocked for 20 minutes before failing;
  • a model that needs more than 20 minutes to start couldn't be given more time, even though the failure message says "Please increase container_timeout_seconds".

This change removes the override, so the requested timeout is used. Callers that don't pass one now get the documented default of 300 seconds, the same as v2, instead of the hard-coded 1200.

Testing:

  • New tests/unit/mode/test_local_container_mode_timeout.py runs create_server with a fake clock and an always-unhealthy ping. It checks the wait ends at the requested timeout, for both 60 s and 1800 s.
  • Before this change both cases stopped at 1220 s.
  • tests/unit/mode: 12 passed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ate_server

create_server overwrote its container_timeout_seconds argument with a
hard-coded 1200 before computing the health-check deadline, so
ModelBuilder.deploy(container_timeout_in_seconds=N) in LOCAL_CONTAINER mode
had no effect: a short timeout still blocked for 20 minutes before failing,
and a model that needs longer than 20 minutes to start could not be given
more time, even though the failure message tells users to increase it.

Remove the override so the requested (documented default: 300) timeout is
used.

This branch is waiting to be deployed

1 waiting deployment
manual-approval — 663499f7 Waiting Oct 12, 2026 by AkshayShah03 via wait-for-approval #616
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant