[WIP] Adding retry logics to the mass-rebuild script #12529
No reviewers
Labels
No labels
after freeze
automation
backlog
blocked
change-ack
change-nak
change-noreleng
changes
Closed As
Can't Fix
Closed As
Duplicate
Closed As
Fixed
Closed As
Fixed with Explanation
Closed As
Get back later
Closed As
Grooming
Closed As
Insufficient data
Closed As
Invalid
Closed As
It's all good
Closed As
taiga
Closed As
upstream
day-to-day
dev
docs
easyfix
epel
f26
f27
f28
f29
f30
f31
f32
f33
f34
f35
f36
f37
f38
f39
f40
f41
f42
f43
f44
f45
fedora
groomed
high-gain
high-trouble
in-progress
in-review
investigation
legal
low-gain
low-trouble
mass rebuild
medium-gain
medium-trouble
meeting
mini-initiative
new_artifact
ops
pdc_retirement
rawhide
RCA
review
script
sidetarget
sprint-0
sprint-1
sprint-2
sprint-3
sprint-4
sprint-5
unfrozen
waiting on external
Backlog Status
Needs Review
Backlog Status
Ready
chore
documentation
points
01
points
02
points
03
points
05
points
08
points
13
Priority
High
Priority
Low
Priority
Medium
release-process
Sprint Status
Blocked
Sprint Status
Done
Sprint Status
In Progress
Sprint Status
Review
Sprint Status
To Do
Technical Debt
Work Item
Bug
Work Item
Epic
Work Item
Spike
Work Item
Task
Work Item
User Story
No milestone
No project
No assignees
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
releng/tickets!12529
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "f42_rebuild_retry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In the updated script, we introduced a retry mechanism to enhance the robustness of the build process.
The retry logic ensures that temporary infrastructure or network issues do not cause permanent failures.
Here’s a summary of what we added:
Retry Wrapper Function (
retry):MAX_RETRIES) and delay (RETRY_DELAY) between attempts.Integration into Core Functions:
buildmeoutput,runme, andrunmeoutputfunctions were modified to utilize the retry mechanism.Improved Logging and Error Handling:
Scalability:
Signed-off-by: Samyak Jain samyak.jn11@gmail.com
This looks pretty nice for making sure submitting builds doesn't fail as much...
The other place in the past we have seen problems is git pushing the rebuild commit. Would it be difficult to add retry for that if it fails?
Couple of minor points:
attempt() is a local function which returns 0 or 1 in buildmeoutput() / runme() and uses retry(), but returns 0 or "result" in runmeoutput() and can't use the retry() function.
retry() also has an attempt variable.
It's probably worth putting some randomization into the sleep() logic, and wait a bit longer than 3 seconds (failure aren't that common, right?) ... so it waits somewhere between 30s and 300s (5m) say. Also means if something temporary happens it doesn't fail 3 times in less than 10s.
But AFAICS, it should be better than nothing as is.
To be clear I'm not saying you should do a bunch of work to integrate all the code, if you want to clean up the first point. Just rename one or both functions, and maybe add a comment.
Going on a tangent from James’s comments, the signalling in that script looks wonky to me – it should use exceptions for flagging errors instead of special return values. However, this isn’t a fault of this PR and probably should be addressed outside of it.
If depending on a 3rd party Python package is okay for this script, take a look at backoff. It implements retrying with increasing backoff times, but works as a decorator on functions. You can specify that certain exceptions or return values flag a need for retry, so it should work with the existing code base.
So... the mass rebuild is ready to fire off now. Should we try and wait to address comments here? Or should we just merge this? Or should we just do the mass rebuild without it?
I would 100% merge it before running the script tomorrow morning. It can be tidied up later, but it's going to make the mass rebuild less of a pain as is.
rebased onto
a0860e3215Merging this, and will handle the cleanups in the next PR! Thanks everyone for the reviews :D
Pull-Request has been merged by jnsamyak