Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a way to randomize retry times #141

Open
sethgupton-mastery opened this issue Sep 25, 2024 · 1 comment
Open

Provide a way to randomize retry times #141

sethgupton-mastery opened this issue Sep 25, 2024 · 1 comment
Assignees

Comments

@sethgupton-mastery
Copy link

Describe the bug
We have a thundering herd problem where a bunch of workflows come in at the same time and need to commit to the same file. They all come in, one succeeds and the rest fail, they wait for retry_wait_seconds, one more succeeds and the rest fail... Repeat until only max_attempts succeeds and the rest fail.

Expected behavior
Add ability to add some randomness to the retry_wait_seconds.

@sethgupton-mastery
Copy link
Author

sethgupton-mastery commented Sep 25, 2024

P.S. We are solving this in a different way right now. But it would be nice to have it built in.

- name: Generate random retry_wait_seconds
  id: randomize-retry
  run: |          
   random_retry_wait=$((5 + RANDOM % 16))
   echo "Random retry wait time: $random_retry_wait seconds"
   echo "retry_wait_seconds=$random_retry_wait" >> $GITHUB_ENV

- name: Commit updates
  uses: nick-fields/retry@v2.8.3
  with:
   timeout_minutes: 2
   retry_on: any
   retry_wait_seconds: ${{ env.retry_wait_seconds }}
   max_attempts: 10
   command: |

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

No branches or pull requests

2 participants