Skip to content

ci: retry transient 5xx responses in the runner demand report - #34337

Merged
OrcaWin merged 2 commits into
mainfrom
ci/runner-demand-retry
Oct 27, 2026
Merged

OrcaWin merged 2 commits into
mainfrom
ci/runner-demand-retry

Conversation

@OrcaWin

@OrcaWin OrcaWin commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator
Files Added Deleted Net
Test 0 0 0 0
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​19 $\color{#cf222e}{\Huge{\mathbf{−}}}$​13 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

Follow-up to #34324. The first post-merge dispatch (run) got past the interval split but then hit a transient Actions API: 500. A report makes ~600 API calls, so a single 5xx shouldn't fail it. This retries 5xx responses up to 3 attempts with 5 s and 10 s backoff. 4xx responses still fail immediately.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bdd531ce-6afe-40eb-9796-564239d9e75a
Commits

Reviewing files that changed from the base of the PR and between 230c9a9 and 56ae9aa.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
Walkthrough

The api helper retries GitHub Actions API responses with status 500 or higher, for up to three attempts. It waits 5 seconds after the first failure and 10 seconds after the second. It returns JSON for successful responses. It throws Actions API: <status> for responses below 500 and after the final failed attempt.

Priority: Low

Merge Risk: Low · previous review 230c9

Cancel failed response bodies to avoid retaining connection resources during the report. The risk is bounded and does not appear to block merging.

Pre-merge checks: Passed 3 · Failed 2

Failed Failed checks: 2 warnings

Check name Status Explanation Resolution
Description check Warning The description explains the failure, the retry behavior, and the backoff intervals, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, Testin… Complete the required template sections. Link the actual issue, state N/A with a reason for Visual Proof if applicable, document testing and platform coverage, address AI Disclosure and review considerations, and complete the checklist.
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 3 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: retrying transient 5xx responses in the runner demand report.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description explains the failure, the retry behavior, and the backoff intervals, but it omits most required template sections, including ELI5, What Changed, Why, Linked Issue, Visual Proof, Testing, AI Disclosure, Review, Notes, and Checklist.

Resolution

Complete the required template sections. Link the actual issue, state N/A with a reason for Visual Proof if applicable, document testing and platform coverage, address AI Disclosure and review considerations, and complete the checklist.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1


Review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d946645c-8ab7-4c9d-84f3-4db48ec4ca19
Commits

Reviewing files that changed from the base of the PR and between 72a4fd1 and 230c9a9.

Files selected for processing: 1
  • config/scripts/ci-runner-demand.mjs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

)
if (!response.ok) {
throw new Error(`Actions API: ${response.status}`)
await new Promise((resolve) => setTimeout(resolve, attempt * 5000))

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.

Minor · Stability & Availability · Quick win

Supported by static analysis

Script executed:

git diff 72a4fd1ac1665930952a1520383490915a48b09f 230c9a955d221bd181de275eaf73680bea705324 -- config/scripts/ci-runner-demand.mjs
sed -n '1,260p' config/scripts/ci-runner-demand.mjs
rg -n 'ci-runner-demand|runner demand' .github config/scripts | head -60

Repository: stablyai/orca

Length of output: 7564


Script executed:

printf '%s\n' '--- workflow ---'
nl -ba .github/workflows/ci-runner-demand.yml | sed -n '1,100p'
printf '%s\n' '--- package/runtime declarations ---'
for f in package.json .nvmrc .node-version; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    nl -ba "$f" | sed -n '1,180p'
  fi
done
printf '%s\n' '--- focused tests and references ---'
nl -ba config/scripts/ci-runner-metrics.test.mjs | sed -n '1,280p'
rg -n -F --glob '*.mjs' -e 'collectRunnerDemand' -e 'request =' -e 'Actions API:' config/scripts .github || test "$?" -eq 1

Repository: stablyai/orca

Length of output: 33066


Cancel failed response bodies before retrying.

The retry loop leaves non-success response bodies undisposed. Cancel each failed body before the backoff or final error. The report limits job requests to four concurrent requests, so the evidence supports a resource-leak risk but not a major or indefinite stall.

Suggested fix
     if (response.ok) {
       return response.json()
     }
+    await response.body?.cancel()
     if (response.status < 500 || attempt === 3) {
       throw new Error(`Actions API: ${response.status}`)
     }

@OrcaWin
OrcaWin merged commit 46cc9ea into main Oct 27, 2026
34 checks passed
@OrcaWin
OrcaWin deleted the ci/runner-demand-retry branch October 27, 2026 09:09
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