Skip to content

fix: retry loop in remove_run_from_status exits without retrying on 422#189

Open
marcosmamorim wants to merge 1 commit into
mainfrom
fix-remove-run-from-status
Open

fix: retry loop in remove_run_from_status exits without retrying on 422#189
marcosmamorim wants to merge 1 commit into
mainfrom
fix-remove-run-from-status

Conversation

@marcosmamorim

Copy link
Copy Markdown
Contributor

Summary

  • Fix broken retry loop in remove_run_from_status that silently
    dropped run removal on 422 (conflict) responses, creating ghost
    run references in status.runs.active
  • Ghost runs at position 0 block the FIFO queue, preventing all
    subsequent runs from executing and blocking subject deletion
  • Adopt the same retry pattern used by add_run_to_status
    (bounded for-loop with max 10 retries and kopf.TemporaryError)

The break statement was outside the try block, causing the while loop
to exit after a single iteration regardless of success or 422 conflict.
On a 422, the subject was refreshed but the removal was never retried,
leaving a ghost run reference permanently in status.runs.active.

This blocked the FIFO run queue, preventing subsequent runs from being
promoted to pending and ultimately preventing subject deletion.

Changed to a bounded for loop (matching add_run_to_status pattern) with
break inside the try block, so 422 conflicts trigger refresh + retry.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant