Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass context to WaitReady of alertmanager Peer interface. #3931

Merged
merged 2 commits into from
Mar 10, 2021

Conversation

stevesg
Copy link
Contributor

@stevesg stevesg commented Mar 9, 2021

What this PR does:
Pass context to WaitReady of alertmanager Peer interface.

Original discussion:
#3839 (comment)

Depends on: prometheus/alertmanager#2509

Checklist
- [X] Tests updated
- [X] Documentation added
- [X] CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Waiting for prometheus/alertmanager#2509 to get merged before marking this PR with an official approval. I've asked @gouthamve to review prometheus/alertmanager#2509.

@@ -584,8 +584,13 @@ func (p *Peer) Ready() bool {
}

// Wait until Settle() has finished.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn’t WaitReady return error, so that client knows whether peer is now ready or not? WDYT?

@@ -110,7 +110,7 @@ func init() {
type State interface {
AddState(string, cluster.State, prometheus.Registerer) cluster.ClusterChannel
Position() int
WaitReady()
WaitReady(context.Context)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
WaitReady(context.Context)
WaitReady(context.Context) error

Copy link
Contributor

@pracucci pracucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pracucci pracucci marked this pull request as ready for review March 10, 2021 11:57
@stevesg
Copy link
Contributor Author

stevesg commented Mar 10, 2021

Rebase

Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
@stevesg
Copy link
Contributor Author

stevesg commented Mar 10, 2021

Fixed mod-check

Copy link
Contributor

@pstibrany pstibrany left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@pstibrany pstibrany merged commit 5d23b16 into cortexproject:master Mar 10, 2021
roystchiang pushed a commit to roystchiang/cortex that referenced this pull request Apr 6, 2022
…ect#3931)

* Update alertmanager.

Signed-off-by: Steve Simpson <steve.simpson@grafana.com>

* Pass context to WaitReady of alertmanager Peer interface.

Signed-off-by: Steve Simpson <steve.simpson@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants