Skip to content

[fix](ci) Retry transient review GET failures within bounded budgets - #69510

Merged
hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/review-get-retry
Nov 2, 2026
Merged

hello-stephen merged 1 commit into
apache:masterfrom
shuke987:codex/review-get-retry

Conversation

@shuke987

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number: N/A

Related PR: #69469

Problem Summary: A single transient GitHub response currently aborts the review pipeline. Input resolution for #69322 stopped on a GET 503 despite Retry-After: 2; aggregate resolution for #69438 stopped on a paginated GET 504 after emitting partial output.

The shared helper now retries recognized body-free REST GETs on 502/503/504, for at most three attempts. Each attempt has a 30-second limit; attempts and waits share a 90-second budget or the caller's shorter timeout. It respects Retry-After, records every failed attempt, discards failed pagination output, and returns only a successful attempt's complete output. Exhaustion still fails. Writes, GraphQL, unknown argument forms, other HTTP errors, transport/timeouts and JSON parsing errors are not retried.

Input resolution can also fail before publishing its PR-number output. Failure notices now fall back to the authorized trigger's numeric PR identity, explicitly select the repository, and name the input-resolution failure in both the notice and terminal error. This fallback does not permit status publication for an unresolved head/base.

This change can merge independently. It includes the same explicit --repo argument as #69469; a local combination with #69469 and #69504 merged cleanly and passed the macOS suite.

Release note

None

Check List (For Author)

  • Test:
    • Unit Test: PYTHONDONTWRITEBYTECODE=1 RUN_GH_HTTP_TESTS=1 python3 -m unittest discover -s .github/scripts -p 'test_*.py' — 281 tests, 262 passed / 19 Linux-only skips on macOS.
    • Manual test: real gh 2.88.1 against a loopback server with fake credentials verifies 503 recovery, whole-pagination restart after 504, three-attempt exhaustion with empty stdout, and no POST retries. Unit cases cover short budgets, Retry-After seconds/dates, malformed or over-budget waits, non-transient errors, cancellation and input-failure notification.
    • Integration: local merge with [fix](ci) Preserve early review failure notifications and causes #69469 and [fix](ci) Install pinned ripgrep without refreshing apt sources #69504 — 294 tests, 275 passed / 19 Linux-only skips; no conflicts.
    • Linux supervision/auth subset in a network-disabled container: 101 of 103 passed. The two failures also reproduce on unchanged base 0d777cd0791553da6f271cb7a62811aa165832fc: test_capacity_after_submission_is_success_without_auth_quarantine and test_success_is_not_quarantined_even_with_earlier_stderr_error. Both old fixtures omit fields required by validate_submission; neither reaches a new retry failure.
    • actionlint 1.7.7 and git diff --check; actionlint disables unavailable ShellCheck/Pyflakes integrations and filters its existing unsupported concurrency.queue diagnostic.
    • Live Actions recovery has not been exercised; no rerun, review comment or status write was manually triggered.
  • Behavior changed:
    • Yes. Transient read failures receive bounded retries; input-resolution failure notices can reach the original PR.
  • Does this need documentation?
    • Yes. Updated .github/scripts/review-github-diagnostics.md in this PR.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

### What problem does this PR solve?

Issue Number: N/A

Related PR: apache#69469

Problem Summary: A transient GitHub 503 aborts review input resolution, and a
504 during pagination aborts aggregate status resolution. The shared gh helper
currently makes one attempt even when GitHub supplies Retry-After. Input
resolution failures also leave the failure notification without a PR number.

Retry only recognized body-free REST GETs on 502/503/504, with at most three
attempts, 30 seconds per attempt and a shared 90-second or shorter caller budget.
Respect Retry-After and retain diagnostics for every failure. Discard failed
pagination output and return only a successful attempt's complete output.
Writes, GraphQL, other HTTP errors and transport/parse failures are not retried.

Use the trigger's numeric PR identity for failure notices when resolved outputs
are absent, specify the repository, and identify the input-resolution failure.
Unresolved head/base values still cannot authorize status publication.

### Release note

None

### Check List (For Author)

- Test: Unit tests and real gh loopback integration; 281 tests completed on
  macOS, 262 passed and 19 Linux-only cases skipped. actionlint and diff-check
  passed; actionlint excludes its pre-existing concurrency.queue diagnostic.
  Linux supervision/auth tests: 101 passed, 2 failed on both this branch and
  unchanged master due to old fixtures missing required submission fields.
- Behavior changed: Yes, transient read failures receive bounded retries and
  input-resolution failures can report to the original PR.
- Does this need documentation: Yes, shared helper behavior is updated in
  .github/scripts/review-github-diagnostics.md in this change.
@hello-stephen

Copy link
Copy Markdown
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

@shuke987

Copy link
Copy Markdown
Contributor Author

/review

@github-actions github-actions 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.

Reviewed all six changed files at head d1c72c478f46d79209d11a4bbb554456dc320ad0, including upstream callers, downstream consumers, negative paths and tests. No actionable new defect was identified; there are no existing inline findings to carry forward.

Critical checkpoint Conclusion
Goal and evidence Eligible transient GET failures receive bounded retries; early input failures retain a PR notification target and specific terminal cause. Added tests cover both behaviors; their execution was not repeated in this review.
Scope, clarity and reuse Changes stay in the shared API helper, failure handling, documentation and tests; retry logic is centralized.
Concurrency and locks Attempts, waits and watchdog reads remain synchronous. No new shared retry state or lock ordering; diagnostic filenames remain unique.
Lifecycle Each subprocess attempt is reaped before retry. The trusted helper is installed before input resolution and survives the PR checkout. No new static initialization or resource ownership issue was identified.
Configuration No user configuration or dynamic setting is added; environment bindings carry existing event/step values.
Compatibility Plain, paginated and Accept-header GET callers retain complete-success output. The 30-second attempt cap and shared operation deadline are explicit policy. No storage or symbol compatibility change applies.
Thrift/protobuf No definitions or field IDs changed.
Parallel paths Traced runner, aggregator, result sync, submission and watchdog paths. Unknown argument forms, including existing --jq reads, intentionally retain single-attempt behavior; existing direct resume reads are outside the shared helper.
Conditional checks and errors Only recognized body-free REST GETs with transient GET response evidence retry. Exhaustion, invalid/excessive Retry-After, timeouts, signals, transport failures and JSON parse failures remain failures. Input fallback rejects invalid PR identities.
Test coverage Static inspection covers transient/non-transient responses, argument exclusions, server waits, total/caller budgets, pagination restart/exhaustion, write isolation, cancellation and notification identity/error paths.
Changed test results No recorded expected-output files changed. The adjusted submission assertion permits positive timeout values within the caller budget.
Observability Every failed attempt retains bounded diagnostics and request context; retry logs state delay/attempt, and both failure outputs identify input-resolution failure. Existing artifact collection remains available.
Transactions and persistence No Doris transaction, EditLog, persistence or failover logic changed.
Writes and atomicity GitHub writes remain single-attempt. Review submission deduplication/readback and resolved-head/base status guards are preserved; notification fallback cannot publish an unresolved review status. Failed paginated stdout is discarded before retry or propagation.
FE/BE propagation No FE/BE variable or protocol changes.
Performance and memory Retries add at most two failed-read waits/attempts within the shared deadline. No new background work or unbounded retained diagnostic data was introduced. Native memory/data-visibility/delete-bitmap invariants are unaffected.
Other issues The initial retry-budget/parser risk was checked against actual callers and tests; no substantiated issue or unresolved candidate remained.

User focus: no additional focus was supplied. Coverage limits: this was a static review; no builds, tests, loopback checks or live Actions recovery were executed. Runtime success and network timing are not claimed.

Review converged after 2 round(s).

@shuke987

shuke987 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

skip buildall

@hello-stephen
hello-stephen merged commit cb41339 into apache:master Nov 2, 2026
39 checks passed
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