fix(engine): route external wakeup callbacks through FlowOperation for correct node targeting#197
Closed
derek-miller wants to merge 1 commit intoNetflix:mainfrom
Closed
Conversation
…r correct pod targeting When Relay fires an HTTP callback, Kubernetes DNS round-robins it to any pod. FlowEngineController was calling FlowExecutor directly, bypassing the RestBasedFlowOperation routing layer that looks up group ownership and forwards to the correct pod. This caused ~94% of wakeups to be silently dropped, falling back to the 30-minute polling reconciliation cycle. Replace FlowExecutor injection in FlowEngineController with FlowOperation so all three endpoints (startFlow, single wakeUp, bulk wakeUp) go through the routing layer. Also add remote-routing tests to RestBasedFlowOperationTest.
d04f382 to
5e3e08b
Compare
harph
approved these changes
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request type
NOTE: Please remember to run
./gradlew spotlessApplyto fix any format violations.Changes in this PR
FlowEngineControllerwas injectingFlowExecutorand calling it directly for all three endpoints (startFlow, singlewakeUp, bulkwakeUp). This bypassedRestBasedFlowOperation— the routing layer that looks up group ownership and forwards requests to the correct node.The consequence: when an external system (e.g. Relay) fires an HTTP callback to the Kubernetes service DNS name, K8s round-robins the request to any pod. If that pod doesn't own the target group,
FlowExecutor.wakeUp()silently returnsfalseand the step falls back to its polling reconciliation cycle.The internal wakeup path (
InstanceActionJobEventProcessor/UpdateJobEventProcessor) already correctly goes throughFlowOperation→RestBasedFlowOperation. This fix makes the external HTTP callback path consistent with that.Fix: replace
FlowExecutorinjection inFlowEngineControllerwithFlowOperation.RestBasedFlowOperationhandles the routing:FlowExecutorThe bulk
wakeUpendpoint is also simplified from a stream of per-refFlowExecutorcalls to a singleflowOperation.wakeUp(groupId, refs, code), doing one DB lookup for the whole batch.New tests in
RestBasedFlowOperationTestverify that when a group is owned by a remote pod,wakeUp(single and bulk) forwards viaRestTemplateand never touches the localFlowExecutor.