From 07c99ef038353031181c5ce3259fa80b4e34a517 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 16 Dec 2025 09:22:55 +0000 Subject: [PATCH] fix: Add rate limiting and retry logic to Google Drive backup sync Resolves HTTP 429 rate limit errors during backup synchronization to Google Drive. Changes: - Reduced concurrent transfers from 8 to 4 (--transfers, --checkers) - Added retry logic: --retries 10, --low-level-retries 10, --retries-sleep 10s - Added rate limiting: --tpslimit 5, --tpslimit-burst 10 - Added API call pacing: --drive-pacer-min-sleep 100ms, --drive-pacer-burst 100 - Increased chunk size from 64M to 256M (fewer API calls for large files) - Increased job timeout from 2 hours to 3 hours to accommodate rate limiting delays This should resolve the "googleapi: got HTTP response code 429" errors that occur when syncing large backup files (~19GB) to Google Drive Shared Drives. --- .../templates/.github/workflows/backup.yaml.tmpl | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/internal/templates/.github/workflows/backup.yaml.tmpl b/internal/templates/.github/workflows/backup.yaml.tmpl index ec0103b2..ee1f27c1 100644 --- a/internal/templates/.github/workflows/backup.yaml.tmpl +++ b/internal/templates/.github/workflows/backup.yaml.tmpl @@ -322,7 +322,7 @@ jobs: sync-to-gdrive: runs-on: ubuntu-latest - timeout-minutes: 120 # 2 Hours + timeout-minutes: 180 # 3 Hours (increased to accommodate rate limiting) needs: {{- range .Resources }} - backup-resource-{{ .Name }} @@ -370,9 +370,16 @@ jobs: # The bucket name folder (e.g., search-spares) will be created automatically rclone sync b2_backup:${BUCKET_NAME} gdrive:${BUCKET_NAME} \ --progress \ - --transfers=8 \ - --checkers=8 \ - --drive-chunk-size=64M \ + --transfers=4 \ + --checkers=4 \ + --retries 10 \ + --low-level-retries 10 \ + --retries-sleep 10s \ + --tpslimit 5 \ + --tpslimit-burst 10 \ + --drive-pacer-min-sleep 100ms \ + --drive-pacer-burst 100 \ + --drive-chunk-size=256M \ --exclude ".DS_Store" \ --exclude "Thumbs.db" \ --stats=30s \