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

lru cache: Only send notifications to the new subscriber #5281

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

sorindumitru
Copy link
Contributor

@sorindumitru sorindumitru commented Jul 6, 2024

When there's a new subscription to the cache we shouldn't notify all existing subscriptions. That causes them to receive updates even if there was no change to the SVIDs or bundles.

This can cause issues with users that trigger side effects, such as restarting a service, when they receive updates on the X509 stream.

I think this shouldn't be ok, I didn't see any reason for the cache notify all subscribers of a set if it knows the new subscriber already.

Pull Request check list

  • Commit conforms to CONTRIBUTING.md?
  • Proper tests/regressions included?
  • Documentation updated?

Which issue this PR fixes
fixes #5280

When there's a new subscription to the cache we shouldn't notify all existing
subscriptions. That causes them to receive updates even if there was no
change to the SVIDs or bundles.

This can cause issues with users that trigger side effects, such as
restarting a service, when they receive updates on the X509 stream.

Signed-off-by: Sorin Dumitru <sdumitru@bloomberg.net>
@sorindumitru sorindumitru force-pushed the extra-notifications branch from 81544fd to 1580ace Compare July 6, 2024 09:23
@amartinezfayo amartinezfayo added this to the 1.10.1 milestone Jul 9, 2024
@amartinezfayo amartinezfayo self-assigned this Jul 9, 2024
Copy link
Member

@amartinezfayo amartinezfayo left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @sorindumitru!

@amartinezfayo amartinezfayo merged commit c75c151 into spiffe:main Jul 17, 2024
33 checks passed
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.

Same SVID is pushed repeatedly on the FetchX509SVID stream by spire-agent with LRU cache
2 participants