Skip to content

atecontroller: deregister workers when their WorkerPool is deleted - #2093

Merged
Scott Funkenhauser (sfunkenhauser) merged 4 commits into
agent-substrate:mainfrom
ericcurtin:workersync-deregister-on-pool-delete
Oct 20, 2026
Merged

Scott Funkenhauser (sfunkenhauser) merged 4 commits into
agent-substrate:mainfrom
ericcurtin:workersync-deregister-on-pool-delete

Conversation

@ericcurtin

Copy link
Copy Markdown
Contributor

The syncer now deregisters the Worker of a pod whose WorkerPool is gone, and reconciles a pool's pods when the pool is deleted. It waits for the pool cache to sync first.

Fixes #2054

  • Tests pass
  • Appropriate changes to documentation are included in the PR (none needed)

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Scott Funkenhauser (@sfunkenhauser) Lior Lieberman (@LiorLieberman) Addressed the review, PTAL when you get a chance. Thank you!

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Max Smythe (@maxsmythe) Bowei Du (@bowei) PTAL when you get a chance, the review feedback is addressed. Thank you!

@maxsmythe

Copy link
Copy Markdown
Collaborator

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Luiz Oliveira (@laoj2) Jeff Luo (@JeffLuoo) PTAL when you get a chance. Thank you!

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Merged main and resolved the conflicts. PTAL.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry for the delay. One more small comment, but otherwise LGTM.

}
if !exists {
return fmt.Errorf("getting WorkerPool %s/%s: not found", key.namespace, poolName)
return s.reconcileMissingPool(ctx, key, pod, poolName)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should raise this up higher in the reconcile flow, before the isWorkerEligible check. If a pod fails the isWorkerEligible check (because the pod isn't ready), createOrUpdateWorker never gets called, and reconcileMissingPool is never triggered.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 3b88e5b. The pool check now runs before the eligibility gate, with a test for a not-Ready orphan.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Main dropped the gate; the pool check still runs first.

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Scott Funkenhauser (@sfunkenhauser) Max Smythe (@maxsmythe) The last note is addressed (pool check now runs before the eligibility gate), PTAL when you get a chance. Thank you!

@sfunkenhauser

Copy link
Copy Markdown
Collaborator

Looks like one of the github workflows is stuck (e2e-test (envoy, preview)). I think this is caused by changes in pr-workflow.yaml, Eric Curtin (@ericcurtin) can you try rebasing and see if that fixes the issue?

@ericcurtin

Copy link
Copy Markdown
Contributor Author

Rebased on main.

Merged via the queue into agent-substrate:main with commit af5b072 Oct 20, 2026
15 checks passed
@ericcurtin
Eric Curtin (ericcurtin) deleted the workersync-deregister-on-pool-delete branch October 20, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api-machinery area/scheduling kind/bug Something isn't working / bugfixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Workers whose WorkerPool is deleted while their pods keep running are never deregistered

4 participants