Skip to content

Conversation

@pstibrany
Copy link
Contributor

What this PR does: This PR changes memberlist.KV to protect calls to methods from ``memberlist.Delegateinterface. Previously these methods were protected byinitWG` field during KV service starting, but not before.

NotifyMsg was previously protected by initWG field too, but this check was removed in #110. In this PR, we re-add the check (using delegateReady).

Note that under normal conditions clients of *memberlist.KV are NOT supposed to call these delegate methods. Only memberlist library calls them via memberlist.Delegate interface.

Which issue(s) this PR fixes:

Fixes problem reported in grafana/mimir#3732.

Checklist

  • Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Calling NotifyMsg while service was still starting could also panic.

This fixes both problems.
Copy link
Contributor

@ortuman ortuman left a comment

Choose a reason for hiding this comment

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

Thanks for the fix Peter!

Just left a small comment, but in general LGTM. 👍

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.

Thanks Peter, LGTM! I also think discarding the messages before the delegate is ready is not an issue.

@pstibrany pstibrany merged commit a9826f9 into main Dec 16, 2022
@pstibrany pstibrany deleted the fix-delegate-access branch December 16, 2022 09:44
charleskorn pushed a commit that referenced this pull request Aug 3, 2023
…uests

Make debug logs on successful requests from GRPCServerLog optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants