Skip to content

docs(job-retry): document that the retry check ignores enable_job_queued_check - #5422

Open
atsikham wants to merge 8 commits into
github-aws-runners:mainfrom
atsikham:fix/job-retry-respect-job-queued-check-flag
Open

atsikham wants to merge 8 commits into
github-aws-runners:mainfrom
atsikham:fix/job-retry-respect-job-queued-check-flag

Conversation

@atsikham

@atsikham atsikham commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Refs #5421

Summary

The job retry function always checks that the job is still queued, independent of enable_job_queued_check. That setting only applies to the scale-up function. This PR documents this, so the behavior is not mistaken for an inconsistency.

The first version of this PR made the retry function follow the setting. After review, this was dropped, because the check has different cost and benefit in the retry path:

  • The retry function runs for a small share of the events, so skipping the check saves little API budget.
  • It runs up to 15 minutes after the original event. The job is then more likely cancelled or already picked up, so skipping the check would create more unused runners.

Changes

  • docs/configuration.md: new paragraph in the "Job retry" section describing this behavior.
  • No code changes.

Test plan

  • Documentation only. The behavior described matches current main: job-retry.ts always calls isJobQueued.

The retry Lambda always called the GitHub API to check whether a job
was still queued before requeuing it, even when ENABLE_JOB_QUEUED_CHECK
is disabled for the main scale-up path. This made it impossible to
fully disable the job-status check, since the retry path kept issuing
it on every retry attempt and consuming rate-limit budget.

Documented the retry lambda now respecting this flag too, in
docs/configuration.md and the enable_job_queued_check variable
descriptions.
@atsikham
atsikham requested review from a team as code owners September 12, 2026 18:46

@Brend-Smits Brend-Smits left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix, this matches the scale-up behavior exactly like the issue asked for.

One thing I'm not 100% sold on though: is mirroring ENABLE_JOB_QUEUED_CHECK onto the retry path actually the right call, or just the consistent one?

On the main scale-up path, disabling the check is a rate-limit tradeoff, you skip an API call per event to save budget, and eat the occasional wasted runner. That makes sense for ephemeral runners (it's even the default when ephemeral is on) because a runner with no job to do just self-terminates, cheap mistake.

But the retry path is a different situation:

  • It only fires for a small slice of events (capacity-limited or failed creation), so the rate-limit savings from skipping the check here are tiny compared to the main path.
  • By the time a retry runs, up to 15 min (with backoff) has passed since the original event, way more likely the job's already been cancelled or picked up by another runner than it was on the first check.

So turning the flag off buys you almost nothing on this path but meaningfully raises the odds you spin up a runner for a job that's already gone. Feels like the retry lambda is exactly the place where you'd want to keep checking regardless of the flag, not inherit it.

And if that's really the tradeoff you want (skip the check everywhere, accept the occasional wasted runner), what's job retry even buying you at that point? Its whole value is "give this job another shot," but if you're not confirming the job is still worth a shot, you're just spending backoff cycles to spin up runners for jobs that may already be done. Feels like disabling the check plus running retry is a slightly contradictory combo, not just disabling the check on its own.

Not saying block on this, just wondering if it was a deliberate call to keep the two paths consistent, or if always-checking on retry (independent of the flag) makes more sense given the different cost/benefit here. Curious what you think. Also curious what other @github-aws-runners/terraform-aws-github-runner-maintainers think of this.

@atsikham

Copy link
Copy Markdown
Contributor Author

The idea was consistency: ENABLE_JOB_QUEUED_CHECK before was only respected by scale-up, so retry checking anyway while flag is disabled feel like inconsistency, not deliberate choice. It was not meant to say retry should skip whenever scale-up do.

But your point about retry economics is correct: skip the check here save very little API budget, but raise the chance a lot we spin up a runner for job already resolved, since more time already passed and job more likely gone by the time retry happen.

So I think is better to decouple: retry should always check, no matter the flag, since "stay consistent with scale-up" it's wrong goal when the two path have different cost/benefit.

If maintainers agree, this PR have nothing left to fix — that's already what main do today. Then either close this PR and issue as not a bug, or I update it to documentation only, explaining why retry ignore the flag on purpose, so it don't come up again. Let me know which you prefer.

@Brend-Smits

Copy link
Copy Markdown
Contributor

The idea was consistency: ENABLE_JOB_QUEUED_CHECK before was only respected by scale-up, so retry checking anyway while flag is disabled feel like inconsistency, not deliberate choice. It was not meant to say retry should skip whenever scale-up do.

But your point about retry economics is correct: skip the check here save very little API budget, but raise the chance a lot we spin up a runner for job already resolved, since more time already passed and job more likely gone by the time retry happen.

So I think is better to decouple: retry should always check, no matter the flag, since "stay consistent with scale-up" it's wrong goal when the two path have different cost/benefit.

If maintainers agree, this PR have nothing left to fix — that's already what main do today. Then either close this PR and issue as not a bug, or I update it to documentation only, explaining why retry ignore the flag on purpose, so it don't come up again. Let me know which you prefer.

Thanks! I appreciate it. I think a documentation update is all we need then. Let me know if you prefer to do it in this PR or a fresh one. Either is fine with me as long as description/title are updated.

…ued_check

The retry function always checks that the job is still queued. The setting
enable_job_queued_check only applies to the scale-up function.
@atsikham atsikham changed the title fix(job-retry): respect ENABLE_JOB_QUEUED_CHECK in retry path docs(job-retry): document that the retry check ignores enable_job_queued_check Sep 25, 2026
@atsikham

atsikham commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

@Brend-Smits done in this PR: docs only, title and description updated.

atsikham and others added 2 commits September 25, 2026 21:26
…ued_check

The retry function always checks that the job is still queued. The setting
enable_job_queued_check only applies to the scale-up function.

This branch has not been deployed

No deployments
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.

2 participants