Repository navigation
Conversation
The discovery manager closes its target-set channel when it stops. The notifier's unlabeled break only exited the inner select, so the target update loop repeatedly received from the closed channel and busy-spun. Return from the target update loop when the channel closes, but keep Run blocked until Stop is called. This preserves shutdown ordering so rule evaluation can finish before notification send loops are drained and cleaned up. Signed-off-by: Arve Knudsen <[email protected]>
Contributor
Author
|
Converting to draft, while waiting on feedback from overlapping PR #17859. |
aknuds1
marked this pull request as draft
July 14, 2026 08:18
bboreham
reviewed
Jul 14, 2026
| func (n *Manager) Run(tsets <-chan map[string][]*targetgroup.Group) { | ||
| n.targetUpdateLoop(tsets) | ||
| // Wait for Stop even if the target update channel closes so callers control when send loops are cleaned up. | ||
| <-n.stopRequested |
Member
There was a problem hiding this comment.
Did you mean to have a defer here?
Contributor
Author
There was a problem hiding this comment.
No, this is the intended logic. The call to targetUpdateLoop blocks until either n.stopRequested is closed or tsets is closed. The idea is to retain the behaviour before the fix, of waiting until n.stopRequested is closed before moving on to cleaning send loops.
Contributor
Author
|
Closing in favour of #17859. |
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.
The discovery manager closes its target-set channel when it stops. The notifier's unlabeled break only exited the inner select, so the target update loop repeatedly received from the closed channel and busy-spun.
Return from the target update loop when the channel closes, but keep Run blocked until Stop is called. This preserves shutdown ordering so rule evaluation can finish before notification send loops are drained and cleaned up.
Follow-up to #19149. Fixes the same class of bug.
Which issue(s) does the PR fix:
Release notes for end users (ALL commits must be considered).
Reviewers should verify clarity and quality.