Rerun --failed: skip jobs whose attempt changed, not only nonterminal ones #306
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Follow-up to the Forgejo 17 rerun support (#297).
fj run rerun --failedkeeps only job ids for the selected jobs, and skips a selected job that an earlier POST has rescheduled only while that job is not yet in a terminal state. If an earlier POST restarts a selected dependent and the dependent finishes before the next refresh, the loop reruns it again, repeating work. A slow refresh or an intervening request widens the window. The whole-run and Gitea failed reruns send a single POST and are not affected.Fix: remember each selected job's original attempt (
watchalready tracks(job.id, attempt)) and skip a job whose attempt changed, including a job that is already terminal again. Extend the dependent-skip test with an incremented attempt that has already completed.Also worth collecting here: the narrow race between a refresh and the POST, and acknowledgement loss (a POST accepted but the response lost).
Fixed in v0.8.3 (#326,
50337f3):fj run rerun --failednow remembers each selected job's attempt and skips any job whose attempt changed, including one that already finished again. Closing. The two narrower cases listed at the end of this issue (the race between a refresh and the POST, and a POST accepted but its response lost) are not covered by that change; please open a new issue if either shows up.