Repository navigation
refactor(reconciler): run batcher and kueuesync as manager runnables - #1024
VLukiantsev merged 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the registration of background runnables (the update batcher and kueue sync) by registering them directly with the controller-runtime manager, allowing them to start and stop in sync with the controllers. Feedback suggests replacing the deprecated manager.RunnableFunc with a custom runnable adapter to ensure compatibility with newer versions of the controller-runtime library.
7d4a3fb to
b97a72f
Compare
b97a72f to
32cad5e
Compare
53e2ff8 to
95512c9
Compare
95512c9 to
bffd7a7
Compare
bffd7a7 to
0683b7d
Compare
There was a problem hiding this comment.
🤖 Incremental PR Approval
Clean rebase detected with zero semantic patch lines changed.
Preserving prior approval by @janzak-dev on commit bffd7a7.
Background loops were started in two ad-hoc places: the JobSet controller's SetupWithManager registered the update batcher as a runnable (coupling an unrelated shared component to one controller), and Manager.Start spawned the kueuesync position-in-queue loop in a bare goroutine outside the controller-runtime lifecycle, with its own cancellation handling. Register both through a single addBackgroundRunnables step in registerControllers via manager.RunnableFunc, so they start after the caches sync and stop together with the controllers on shutdown. registerControllers now returns only the batcher, the Manager no longer tracks the kueuesync reconciler, and Manager.Start simply delegates to the controller-runtime manager. Tests: fakeControllerManager records added runnables; the new TestAddBackgroundRunnables covers the success path (two runnables), kueuesync construction failure, and manager Add failure. TAG=agy CONV=01d33a7b-38ec-4d7e-bfc6-b0e56c70a294
0683b7d to
2124674
Compare
There was a problem hiding this comment.
🤖 Incremental PR Approval
Clean rebase detected with zero semantic patch lines changed.
Preserving prior approval by @janzak-dev on commit bffd7a7.
Summary
Registers the update batcher and the kueuesync position-in-queue loop as controller-runtime manager runnables, so both start after caches sync and stop with the controllers on shutdown.
Stack: Part 4/5 of stack; depends on #1023.
Motivation & Context
Background loops were started in two ad-hoc places: the JobSet controller's
SetupWithManagerregistered the batcher (coupling a shared component to one controller), andManager.Startspawned kueuesync in a bare goroutine outside the controller-runtime lifecycle with its own cancellation handling. A single, manager-owned lifecycle removes that duplication and ordering risk.Key Changes
addBackgroundRunnablesstep inregisterControllersadds both loops viamanager.RunnableFunc.registerControllersreturns only the batcher;Managerno longer tracks the kueuesync reconciler;Manager.Startdelegates to the controller-runtime manager.fakeControllerManagerrecords added runnables;TestAddBackgroundRunnablescovers success (two runnables), kueuesync construction failure and managerAddfailure.Assumptions
bazel coverageyields empty reports forcompat_go_*targets (pre-existing tooling limitation).Verification & Testing
bazel build //cmd/reconciler/...,bazel test //cmd/reconciler/...,.githooks/pre-commit.batcher_*metrics served, and the E2E WorkUnit reachedCOMPLETED.Related Issues / Bugs
N/A
TAG=agy
CONV=3b97e4d5-890c-4d84-b18b-da955eeb96cd