Skip to content

feat: Add initial support for cleaning orphaned jobs#1427

Merged
lbeckman314 merged 12 commits into
developfrom
feat/orphaned-executor-job
Jun 9, 2026
Merged

feat: Add initial support for cleaning orphaned jobs#1427
lbeckman314 merged 12 commits into
developfrom
feat/orphaned-executor-job

Conversation

@lbeckman314

@lbeckman314 lbeckman314 commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Overview

This PR addresses the orphaned Executor Job cleanup gap identified in the PR #1423 review.

Current Behavior ⚠️

Currently CleanOrphanedResources does not scan for orphaned Executor Jobs (app=funnel-executor).

If a worker job completes or is cleaned up but one or more of its Executor Jobs remain, those jobs are never discovered and never deleted — leaking Kubernetes resources.

New Behavior ✔️

CleanOrphanedResources now:

  • Lists all Executor Jobs (via the app=funnel-executor label selector)
  • Parses the parent task ID from each job name ({taskID}-{index})
  • Feeds those task IDs into the existing isResourceCleanupNeededcleanResources pipeline

This ensures orphaned Executor Jobs for terminal or missing tasks are cleaned up on the same schedule as other orphaned resources.

Breaking Changes? ❌

No, CleanOrphanedResources is an additional check — existing cleanup behavior is unchanged; this only adds Executor Jobs to the set of resources it considers.

Next Steps 🌀

Signed-off-by: Liam Beckman <lbeckman314@gmail.com>
- K8s fake client does not support cascading delete from Owner field

Signed-off-by: Liam Beckman <lbeckman314@gmail.com>
Signed-off-by: Liam Beckman <lbeckman314@gmail.com>
[skip ci]

Signed-off-by: Liam Beckman <lbeckman314@gmail.com>
Signed-off-by: Liam Beckman <lbeckman314@gmail.com>
Move backend.go and backend_test.go resource cleanup changes to
review/service-account-deletion (PR #1423) per reviewer request.
PR #1421 should only contain the ServiceAccount deletion race condition fix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Assisted-by: Claude Code:claude [Claude Code]
Signed-off-by: Liam Beckman <lbeckman314@gmail.com>
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Gen3 Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

Gen3 Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@lbeckman314
lbeckman314 merged commit 0161c4d into develop Jun 9, 2026
19 checks passed
@lbeckman314
lbeckman314 deleted the feat/orphaned-executor-job branch June 9, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants