Repository navigation
feat(load): exit 75 and report retryable when a rerun may fix every failure - #183
Merged
Merged
Conversation
…ailure plan, apply, load and copy exit 75 (EX_TEMPFAIL) instead of 1 when every failure is one a rerun may get past: a dropped, refused or timed-out connection, throttling or server errors that outlasted their retries, a transient Postgres SQLSTATE, a table another run is loading, or a Python table that raised ConnectionError or TimeoutError. --json reports say so with retryable on the run, each table, the plan and the error document.
…object stores Target failures while a source streams keep their classification; CDC loads report it; Postgres retries only exact transient SQLSTATEs (not 08P01, which PgBouncer sends for an unknown database); unbuildable requests and answers that are not the JSON expected are protocol errors; object store connect and timeout errors count; logged-state keeps exit 1.
Deploying sqlload with
|
| Latest commit: |
6098824
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://427ee4ae.sqlload.pages.dev |
| Branch Preview URL: | https://feat-retryable-exit-codes.sqlload.pages.dev |
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.
plan,apply,loadandcopynow tell a scheduler whether to retry. They exit 75 (EX_TEMPFAIL) instead of 1 when every failure is one a rerun may get past. Under--json,retryablesays the same thing on the run, on each table, inplanand in the{"error": …}document.retryableistrueexactly when the exit code is 75. Everything else is unchanged: 0 for success, 1 for any lasting failure, 2 for usage and 130 for a forced stop.What already worked before this change (CHI-1241 confirmation):
sl.httppaging, auth and retries: six paginators, bearer, API-key, basic and OAuth2 auth (client credentials and refresh token, with renewal on expiry or a 401), and retries on transport errors, 429 and 5xx that honourRetry-After.packages/sqlload/tests/test_http_jobs.pycovers these (retries-429-and-503, the paginator cases and the OAuth renewal tests).load --jsonreport: a stable document versioned byschema_version: 1, documented on theloadpage, withokmatching exit 0.test_batched_loads.rs). Logged tables resume from their last checkpoint (test_logged_state.py).replaceswaps in only at the end.What was missing: a scheduler couldn't tell a dropped connection from a broken configuration, because both exited 1.
Classification (
LoaderError::is_retryable):sl.httpjob whose retries ran out on 429, 5xx or transport errors.ConnectionErrororTimeoutError.read_sourceremembers the publisher's error. CDC loads without--followreport it too.Tests:
retryable: true. A rerun loads every row exactly once.ValueError: exit 1, and each table says which kind it is.sl.http500 after its retries: exit 75. A 404: exit 1.Docs: an exit code table entry and a "Retrying failed runs" section in
cli/index.mdx, plus the new fields incli/load.mdx, marked "From 0.34.0 (not released yet)".Checks:
make check(fensu 0 faults),make test-unit, andmake test-python(340 passed). Reviewed once, plus a follow-up check of the fixes.