feat(cadence-matching): Add drain observer for SD executor client#7751
Merged
gazi-yestemirova merged 1 commit intocadence-workflow:masterfrom Feb 26, 2026
Merged
Conversation
Signed-off-by: Gaziza Yestemirova <gaziza@uber.com>
Code Review ✅ ApprovedClean parameter threading for drain observer through the matching service initialization chain. Follows the established pattern, is nil-safe, and tests are updated appropriately. Rules ❌ No requirements metRepository Rules
2 rules not applicable. Show all rules by commenting OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
eleonoradgr
approved these changes
Feb 26, 2026
jakobht
approved these changes
Feb 26, 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.
What changed?
This PR adds DrainObserver field to resource.Params to inject a DrainSignalObserver into the matching service at initialization.
We wire the drain observer through matching.Service -> handler.NewEngine -> setupExecutor -> executorclient.Params, enabling the executor client's heartbeat loop to react to infrastructure drain/undrain signals.
Why?
The shard-distributor executor client already supports drain-aware behavior via the DrainObserver field on executorclient.Params. However, there was no way to wire a DrainSignalObserver into the matching service's executor client because resource.Params didn't have it.
PR follows the same pattern used by ShardDistributorMatchingConfig initialization.
How did you test it?
Unit tests with
go test -v ./service/matching/handler/Potential risks
Since drainObserver field is optional there wouldn't be any changes in cadence-matching's behaviour.
Release notes
N/A
Documentation Changes
N/A
Reviewer Validation
PR Description Quality (check these before reviewing code):
go testinvocation)