Repository navigation
Retry hako oneshot when no tasks started - #104
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR improves resiliency of the Hako executor by retrying hako oneshot when it fails with NoTasksStarted (observed on ECS Managed Instances), instead of failing the job immediately. The retry behavior is applied consistently to both initial executions and retries.
Changes:
- Add
NoTasksStarteddetection and retry loop (up to 10 attempts) tostart_executionandstart_retry. - Introduce
no_tasks_started?helper to identify theNoTasksStartedfailure from Hako output. - Add RSpec coverage for success-after-retries and give-up-after-max-retries behavior for both execution and retry flows.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/barbeque/executor/hako.rb |
Implements NoTasksStarted detection and retry logic for both execution paths. |
spec/barbeque/executor/hako_spec.rb |
Adds specs validating the new retry behavior for start_execution and start_retry. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+40
to
+42
| max_no_tasks_started_retries = 10 | ||
| max_no_tasks_started_retries.times do |i| | ||
| stdout, stderr, status = Bundler.with_unbundled_env { Open3.capture3(@hako_env, *cmd, chdir: @hako_dir) } |
Comment on lines
+70
to
+72
| max_no_tasks_started_retries = 10 | ||
| max_no_tasks_started_retries.times do |i| | ||
| stdout, stderr, status = Bundler.with_unbundled_env { Open3.capture3(@hako_env, *cmd, chdir: @hako_dir) } |
Retry the hako oneshot command up to 10 times when it fails with NoTasksStarted, which can happen on ECS Managed Instances, instead of failing the job immediately. Apply the same retry to both start_execution and start_retry. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
eagletmt
force-pushed
the
retry-if-no-tasks-started
branch
from
June 17, 2026 08:47
3c342c6 to
c0ec9ee
Compare
nekketsuuu
approved these changes
Jun 17, 2026
| Barbeque::SlackNotifier.notify_job_execution(job_execution) | ||
| job_execution.retry_if_possible! | ||
|
|
||
| max_no_tasks_started_retries = 10 |
Contributor
There was a problem hiding this comment.
nit: How about using a constant?
mozamimy
approved these changes
Jun 18, 2026
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.
Retry the hako oneshot command up to 10 times when it fails with NoTasksStarted, which can happen on ECS Managed Instances, instead of failing the job immediately. Apply the same retry to both start_execution and start_retry.