Repository navigation
Conversation
The reader goroutine deferred the gauge update directly, so Go evaluated readersGauge.Add(-1) when each reader started and recorded that stale value when it exited. platform_trigger_coordinator_readers read 1-3 per node in staging against 988 coordinated workflows. Defer a closure so the decrement and the record both happen on exit. Add a regression test that registers three triggers, holds the gauge and counter at three while the readers run, and expects zero after unregistering.
Contributor
|
👋 MStreet3, thanks for creating this pull request! To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team. Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks! |
Contributor
|
I see you updated files related to
|
Contributor
|
✅ No conflicts with other open PRs targeting |
Contributor
Author
|
Superseded by #24258, which makes the coordinator gauges observable to also fix a race in recording them. |
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.
CRE-7344
What this fixes
platform_trigger_coordinator_readersshould count the trigger reader goroutines on a node. In staging it read 1–3 per node, whileplatform_trigger_coordinator_workflowsread 988 on the same Zone A nodes.Each reader goroutine (added in #23945) deferred the gauge update directly:
Go evaluates a deferred call's arguments when the
deferruns. So the counter dropped when each reader started, and that stale value was recorded when the reader exited. Every exit pushed the gauge to a small, wrong number. The fix defers a closure, so the decrement and the record both happen on exit.Metrics only:
readersGaugefeeds nothing but this gauge, and trigger reading and execution are unchanged.Test
TestCoordinator_ReadersGaugeregisters a workflow with three triggers. It holds for 100ms and checks that both the internal counter and the exported gauge read 3 while the readers run, then checks that the gauge returns to 0 after unregistering. It fails on every run against the old code and passes with-race.Requires
None.
Supports
None.
Deployment Validation Steps
platform_trigger_coordinator_readersper node should be at leastplatform_trigger_coordinator_workflows, since each workflow has one or more triggers.