feat(batch): retryStrategy + timeout (batch 5)#1989
Merged
Conversation
- spawn_status_sync now loops over attempts: on a non-zero container exit, if retryStrategy.attempts remain it records the failed attempt under attempts[] and re-launches a fresh ECS task (status RUNNABLE -> STARTING), otherwise fails the job. Honors the 1-10 attempts clamp. - timeout.attemptDurationSeconds caps each attempt's poll loop; an overrunning container fails the job with "Job attempt duration exceeded timeout". - Extracted set_job_terminal helper for the SUCCEEDED/FAILED write. Tests: Docker-gated e2e — retry_strategy_reattempts_a_failing_job (exit 4, attempts=2 -> FAILED with one recorded retry) and timeout_fails_an_overrunning_job (sleep 60, attemptDurationSeconds=2 -> FAILED "timeout"). Existing success/fail/array/dependsOn e2e unaffected. Docs updated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AWS Batch batch 5 — retry strategies + job timeouts.
spawn_status_syncloops over attempts: on a non-zero container exit, ifretryStrategy.attemptsremain it records the failed attempt underattempts[]and re-launches a fresh ECS task (statusRUNNABLE → STARTING), else fails the job. Attempts clamped to AWS's 1-10.timeout.attemptDurationSecondscaps each attempt's poll loop; an overrunning container fails the job with "Job attempt duration exceeded timeout".set_job_terminalfor the SUCCEEDED/FAILED write.Test plan
retry_strategy_reattempts_a_failing_job(exit 4, attempts=2 → FAILED with one recorded retry + exitCode 4) andtimeout_fails_an_overrunning_job(sleep 60, attemptDurationSeconds=2 → FAILED "timeout"). Both pass locally.cargo clippy -p fakecloud-batch -p fakecloud-e2e --all-targets -- -D warningsclean. Docs updated.Next (final Batch batch)
CloudFormation provisioner for
AWS::Batch::ComputeEnvironment/JobQueue/JobDefinition(write-through + snapshot hook) + Terraform acceptance-test coverage.Summary by cubic
Adds AWS Batch retry strategies and per-attempt timeouts to real job execution. Failed attempts re-launch up to
retryStrategy.attempts(1–10) with attempts recorded; overruns fail with a clear timeout reason. Docs updated and e2e coverage added.New Features
retryStrategy.attempts: on non‑zero exit, record inattempts[]and re-launch a fresh ECS task (RUNNABLE → STARTING) until attempts are exhausted.timeout.attemptDurationSeconds: cap each attempt; on overrun, fail with "Job attempt duration exceeded timeout".container.exitCodeandstatusReason.Refactors
set_job_terminalhelper for SUCCEEDED/FAILED writes.Written for commit b670f64. Summary will update on new commits.