Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Complete ADS snapshot cache implementation #5017

Merged
merged 1 commit into from
Aug 26, 2022

Conversation

steeling
Copy link
Contributor

@steeling steeling commented Aug 23, 2022

This completes the ADS snapshot cache implementation, but does not flip the flag to enable it. This is accomplished by:

  1. Switch the AddJob method to return a writable channel, so that it can be closed. This removes a channel resource leak.
  2. Move the WatchUpdate logic into the OnStreamOpen, so that there is one routine running per connected proxy. This maintains current status quo, and makes it simpler to implement with the current message broker setup.
  3. Add in the missing metrics tracking

Part of #2683

Signed-off-by: Sean Teeling seanteeling@microsoft.com

Signed-off-by: Sean Teeling <seanteeling@microsoft.com>
Copy link
Contributor

@keithmattix keithmattix left a comment

Choose a reason for hiding this comment

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

LGTM!

}
}

func (s *Server) allPodUpdater() {
Copy link
Contributor

Choose a reason for hiding this comment

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

We really updated all the pods every time a single pod got an update event? Big save of resources here!

@@ -44,18 +45,59 @@ func (s *Server) OnStreamOpen(ctx context.Context, streamID int64, typ string) e
}

s.proxyRegistry.RegisterProxy(proxy)
go func() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this make sense to abstract into a separate function like in the previous implementation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry i prematurely merged this.. i'm still investigating ways we can abstract this stuff more. I've taken a note to revisit this :)

@steeling steeling merged commit 2d94011 into openservicemesh:main Aug 26, 2022
@steeling steeling deleted the feature/snapshot-pub branch August 26, 2022 16:39
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants