gh-134262: Add retries to generate_sbom.py#134263
Conversation
generate_sbom.py downloads artifacts, which can flake. This commit adds exponential backoff to the download to avoid failures due to network flakes.
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
- Add `base_delay` for retries - use a for loop instead of while loop - rename retries to max_retries
|
Thanks! And backport to 3.13? |
|
Yeah backport to 3.14 and 3.13 is probably a good idea. |
|
Would you like to add the "needs backport" labels? |
|
Thanks @emmatyping for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @emmatyping for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
(cherry picked from commit 0c5a8b0) Co-authored-by: Emma Smith <emma@emmatyping.dev> Co-authored-by: Semyon Moroz <donbarbos@proton.me>
|
Sorry, @emmatyping and @hugovk, I could not cleanly backport this to |
|
GH-134460 is a backport of this pull request to the 3.14 branch. |
|
Here's a build that failed even with https://github.com/python/cpython/actions/runs/15169080044/job/42654367027?pr=134456 Shall we bump some numbers? And print out Would help us identify any flaky resources and possibly fetch from a reliable location. |
|
Yeah, I can bump numbers (wanted to be conservative initially), note the location, and maybe add jitter? |
|
Thanks, not sure how much jitter would help here, but no objection. |
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
) (cherry picked from commit 0c5a8b0) Co-authored-by: Emma Smith <emma@emmatyping.dev> Co-authored-by: Semyon Moroz <donbarbos@proton.me>
|
GH-137468 is a backport of this pull request to the 3.13 branch. |
Tools/build/generate_sbom.pydownloads artifacts, which can flake. This commit adds simple exponential back-off retries to the download to avoid failures due to network flakes.