Skip to content

implement exponential backoff on http 429 errors #1432

Open
@lovasoa

Description

@lovasoa

Hello !
Recently, I've had issues to run a large workflow that used to run fine.
actions/checkout@v3 fails with the following message: The requested URL returned error: 429.

Run actions/checkout@v3
Syncing repository: lovasoa/sqlx-oldapi
Getting Git version info
Temporarily overriding HOME='/home/runner/work/_temp/953a1d70-3933-4dbc-9926-54293e0cd10e' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
/usr/bin/git config --global --add safe.directory /home/runner/work/sqlx-oldapi/sqlx-oldapi
Deleting the contents of '/home/runner/work/sqlx-oldapi/sqlx-oldapi'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +5eeb386d401944bbb77fe04d859d7400cc56f13c:refs/remotes/origin/main
  Error: fatal: unable to access 'https://github.com/lovasoa/sqlx-oldapi/': The requested URL returned error: 429
  The process '/usr/bin/git' failed with exit code 128
  Waiting 19 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +5eeb386d401944bbb77fe04d859d7400cc56f13c:refs/remotes/origin/main
  Error: fatal: unable to access 'https://github.com/lovasoa/sqlx-oldapi/': The requested URL returned error: 429
  The process '/usr/bin/git' failed with exit code 128
  Waiting 15 seconds before trying again
  /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin +5eeb386d401944bbb77fe04d859d7400cc56f13c:refs/remotes/origin/main
  Error: fatal: unable to access 'https://github.com/lovasoa/sqlx-oldapi/': The requested URL returned error: 429
  Error: The process '/usr/bin/git' failed with exit code 128

In the logs, one can see that the retry delay decreases instead of increasing between retries.

Maybe this action should detect 429 (too many requests) error, and try to avoid sending too many requests by implementing exponential backoff (or following the retry instructions sent in the HTTP response headers if any).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions