fix: retry S3 hiccups (signed for the host on every try), clear a backup error once the destination checks out, log backups and failed jobs #37
Loading…
Reference in a new issue
No description provided.
Delete branch "backup-logging-retries"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
From trying backups in prod against Backblaze B2.
Retries, and a signing bug they exposed. B2 answers 500 now and then, which failed the whole backup until Oban retried the job. S3 requests now retry transient failures (408/429/5xx, dropped connections) up to 4 times with Req's backoff. Writing the test for that found that a retry re-runs every request step, so SigV4 signed the pinned IP as the host (the URL
pin_addresshad left), sendingHost: <ip>with a signature for the IP. Req's default already retried GETs this way in 1.1.x. Now anunpin_addressstep puts the host back first, so every try is signed for the hostname and sent to the checked address; the fake bucket asserts both on retries too.The error after a good Test connection.
Backups.check/1now clearslast_errorwhen the destination checks out (and tells the page), since the error was about a destination that now works; the next backup reports anything still wrong.Logging (there was next to none):
x-amz-request-id/x-amz-id-2; endpoints refused by the network check;RmAnalyzer.JobLogger): nothing logged them before, so failing OCR/sorting/tagging/backup jobs were silent. A warning while they'll be retried, an error with the stacktrace once given up on. Successful jobs aren't logged.Tests: a 500 retried twice then succeeding (with the request id in the log), a 503 that lasts (giving up, logged, backup failed as an error), a check clearing the error, and the job logger. 715 passed; checked live against B2 us-west-000.