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

Make remote controller access thread safe. #251

Merged
merged 4 commits into from
Aug 1, 2022

Conversation

aattuluri
Copy link
Contributor

No description provided.

ServiceEntryAddressStore: &ServiceEntryAddressStore{EntryAddresses: map[string]string{}, Addresses: []string{}},
GlobalTrafficCache: gtpCache,
SeClusterCache: common.NewMapOfMaps(),

Copy link
Collaborator

Choose a reason for hiding this comment

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

nitpick: empty line.

@@ -100,8 +100,8 @@ func TestAddServiceEntriesWithDr(t *testing.T) {
},
}

AddServiceEntriesWithDr(&admiralCache, map[string]string{"cl1": "cl1"}, map[string]*RemoteController{"cl1": rc}, map[string]*istionetworkingv1alpha3.ServiceEntry{"se1": &se})
AddServiceEntriesWithDr(&admiralCache, map[string]string{"cl1": "cl1"}, map[string]*RemoteController{"cl1": rc}, map[string]*istionetworkingv1alpha3.ServiceEntry{"se1": &emptyEndpointSe})
AddServiceEntriesWithDr(&RemoteRegistry{AdmiralCache: &admiralCache, remoteControllers: map[string]*RemoteController{"cl1": rc}}, map[string]string{"cl1": "cl1"}, map[string]*istionetworkingv1alpha3.ServiceEntry{"se1": &se})
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use constructor (NewRemoteRegistry) here instead?

@@ -62,7 +62,7 @@ func TestDeleteCacheControllerThatDoesntExist(t *testing.T) {
func TestDeleteCacheController(t *testing.T) {

w := RemoteRegistry{
RemoteControllers: make(map[string]*RemoteController),
remoteControllers: make(map[string]*RemoteController),
Copy link
Collaborator

@nirvanagit nirvanagit Aug 1, 2022

Choose a reason for hiding this comment

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

I think it will be useful to use the constructor (NewRemoteRegistry) everywhere, and make RemoteRegistry private.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To make it private we will need an interface for RemoteRegistry.

@aattuluri aattuluri merged commit 5c7b62e into master Aug 1, 2022
@aattuluri aattuluri deleted the Fix-remote-controller-concurrent-map-access branch August 1, 2022 20:36
itsLucario pushed a commit to itsLucario/admiral that referenced this pull request Aug 9, 2022
…io-ecosystem#147)

* Make remote controller access thread safe.

* Lint issue

* Code review comments

* More initializations fixed

Co-authored-by: aattuluri <44482891+aattuluri@users.noreply.github.com>
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.

2 participants