Skip to content

Keep waiting after a transient server or network error - #91

Open
atharv1205 wants to merge 1 commit into
prooflinedev:mainfrom
atharv1205:fix/wait-through-transient-errors
Open

atharv1205 wants to merge 1 commit into
prooflinedev:mainfrom
atharv1205:fix/wait-through-transient-errors

Conversation

@atharv1205

Copy link
Copy Markdown

Problem

One transient failure during a poll ended the whole wait. The failure could be a 502, 504, 503 or 429 with a Retry-After over 60 s, a timeout or a reset connection. Api::read retries only 429/503 with a short Retry-After, and every poll loop passed the first error up with ?. So a 30-minute ci review or a 1-hour ci deploy --until 1h failed on one load-balancer blip:

  • ci review and ci deploy exited 4.
  • review --wait, findings --wait, rerun and the hooks exited 1.

This happened with most of --timeout unused, even though the next poll would have returned the result.

Fix

polled() in src/lib.rs is used by read_review, wait_for_head_review and deploy::wait.

  • Failures on Proofline's side: the ones unavailable() already classifies, plus 429. The loop logs one line and reads again on the normal backoff, never sleeping past the deadline.
  • At the deadline: the error ends the wait exactly as before, with the same exit codes.
  • Refusals: 401, 403, 404 and contract errors still end the wait at once.
  • POSTs: never retried.

Tests

  • tests/http.rs a_wait_reads_again_after_a_failed_read_and_stops_at_a_refusal
  • src/deploy.rs a_failed_read_is_read_again_and_a_refusal_ends_the_wait
  • src/deploy.rs a_console_that_keeps_failing_ends_the_wait_at_the_timeout

Changed: a_wait_renews_its_credential_and_a_refused_renewal_ends_it. A credential renewal answered with 503 is now tried again at each poll and ends at the deadline (still exit 4, still no review request), instead of ending immediately.

cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, cargo test --locked and cargo deny check pass.

A single 5xx, 429, timeout or dropped connection during a poll ended review, ci review and ci deploy waits at once, even with most of --timeout left. Poll loops now read again at the next interval and end with the same error only at the deadline. Refusals still end the wait immediately, and no POST is retried.

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.

1 participant