8000 gh-134262: Add retries to generate_sbom.py by emmatyping · Pull Request #134263 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134262: Add retries to generate_sbom.py #134263

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

Merged
merged 6 commits into from
May 21, 2025

Conversation

emmatyping
Copy link
Member
@emmatyping emmatyping commented May 19, 2025

Tools/build/generate_sbom.py downloads artifacts, which can flake. This commit adds simple exponential back-off retries to the download to avoid failures due to network flakes.

generate_sbom.py downloads artifacts, which can
flake. This commit adds exponential backoff to the
download to avoid failures due to network flakes.
Copy link
Contributor
@sethmlarson sethmlarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

emmatyping and others added 2 commits May 19, 2025 12:45
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
@hugovk hugovk merged commit 0c5a8b0 into python:main May 21, 2025
46 checks passed
@hugovk
Copy link
Member
hugovk commented May 21, 2025

Thanks! And backport to 3.13?

@emmatyping
Copy link
Member Author

Yeah backport to 3.14 and 3.13 is probably a good idea.

@hugovk
Copy link
Member
hugovk commented May 21, 2025

Would you like to add the "needs backport" labels?

@emmatyping emmatyping added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels May 21, 2025
@miss-islington-app
Copy link

Thanks @emmatyping for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Thanks @emmatyping for the PR, and @hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 21, 2025
(cherry picked from commit 0c5a8b0)

Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
@miss-islington-app
Copy link
8000

Sorry, @emmatyping and @hugovk, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 0c5a8b0b55238a45b9073d06a10c3a59568cdf3c 3.13

@bedevere-app
Copy link
bedevere-app bot commented May 21, 2025

GH-134460 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label May 21, 2025
@hugovk
Copy link
Member
hugovk commented May 21, 2025

Here's a build that failed even with download_with_retries:

https://github.com/python/cpython/actions/runs/15169080044/job/42654367027?pr=134456

Shall we bump some numbers? And print out download_with_retries and the current retry/delay?

Would help us identify any flaky resources and possibly fetch from a reliable location.

@emmatyping
Copy link
Member Author

Yeah, I can bump numbers (wanted to be conservative initially), note the location, and maybe add jitter?

@hugovk
Copy link
Member
hugovk commented May 21, 2025

Thanks, not sure how much jitter would help here, but no objection.

lkollar pushed a commit to lkollar/cpython that referenced this pull request May 26, 2025
Co-authored-by: Semyon Moroz <donbarbos@proton.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0