Open sethgupton-mastery opened 1 month ago
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: |
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 onlymax_attempts
succeeds and the rest fail.Expected behavior Add ability to add some randomness to the
retry_wait_seconds
.