Skip to content

Conversation

@ZetaoZhuang
Copy link
Contributor

@ZetaoZhuang ZetaoZhuang commented Oct 3, 2022

Reason for Change:

To enable AZR , dnc need to call CNS to get home az infos from NMAgent. This PR is for exposing the getHomeAzInfo api in cns to achieve that.

caching homeaz infos will be covered in separated PR

Issue Fixed:

Requirements:

Notes:
task link

@ZetaoZhuang ZetaoZhuang requested a review from a team as a code owner October 3, 2022 18:04
@ZetaoZhuang ZetaoZhuang requested review from thatmattlong and removed request for a team October 3, 2022 18:04
timraymond
timraymond previously approved these changes Oct 10, 2022
timraymond
timraymond previously approved these changes Oct 11, 2022
smittal22
smittal22 previously approved these changes Oct 25, 2022
Copy link
Contributor

@smittal22 smittal22 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

rbtr
rbtr previously requested changes Nov 2, 2022
Copy link
Collaborator

@rbtr rbtr left a comment

Choose a reason for hiding this comment

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

do I understand correctly that nothing is currently populating these "cache" values? why not make them pull-through, so that the first attempt to read the cache does the look-up if the value has not been set? I prefer that to having an out-of-band cache put process.

Comment on lines 944 to 949
func (service *HTTPRestService) readNMASupportedApisCache() []string {
service.RLock()
supportedApis := service.nmaSupportedApisCache
service.RUnlock()
return supportedApis
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I know that doing this with a map would not be thread-safe; I am not sure if returning a slice like this is thread-safe, since the slice is a sort of reference type and the underlying array can be mutated through any copy of the slice?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ya, the slice is a sort of reference type. I don't see any scenario we would mutate the copy slice for now. But I can do a deep copy here so it has 0 chance to mutate the underlying cache value.

@ZetaoZhuang
Copy link
Contributor Author

do I understand correctly that nothing is currently populating these "cache" values? why not make them pull-through, so that the first attempt to read the cache does the look-up if the value has not been set? I prefer that to having an out-of-band cache put process.

Ya, currently nothing is populated to these caches. Based on the design we agreed on, we will have a thread to query home az from nmagent and cache the value when cns starts. @ashvindeodhar

Copy link
Member

@timraymond timraymond left a comment

Choose a reason for hiding this comment

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

I have more thoughts here, but I just want to checkpoint this review so that some feedback can be provided before I'm finished.

Copy link
Member

@timraymond timraymond left a comment

Choose a reason for hiding this comment

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

Some more questions on the CachedClient (it is looking better!). Also have some other questions about error handling.

@ZetaoZhuang ZetaoZhuang force-pushed the GetHomeAzInfo branch 2 times, most recently from 41ee6ec to acafba7 Compare November 8, 2022 18:23
@rbtr rbtr dismissed their stale review December 2, 2022 23:16

outdated

@ZetaoZhuang ZetaoZhuang enabled auto-merge (squash) December 2, 2022 23:21
@ZetaoZhuang
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@aegal
Copy link
Contributor

aegal commented Dec 6, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ashvindeodhar ashvindeodhar merged commit e6eadd3 into master Dec 8, 2022
@ashvindeodhar ashvindeodhar deleted the GetHomeAzInfo branch December 8, 2022 16:23
@rbtr
Copy link
Collaborator

rbtr commented Dec 8, 2022

@ashvindeodhar please leave a note explaining why this was merged bypassing checks

@ashvindeodhar
Copy link
Member

@rbtr sorry, I added a note but seems didn't hit the 'comment' button.
Merging this bypassing the windows check which has been failing for last few days. We need this change for making progress on aquarius changes and testing the critical AZR feature in timely fashion. This change is not updating any existing code / functionality so risk of any windows regressions are very low. This code adds new functionality which is currently not used. After checking with pipeline v-team ( Esteban ), I came to know that this might need few more days to fix this windows pipeline issue.

rjdenney pushed a commit to rjdenney/azure-container-networking that referenced this pull request Jan 19, 2023
smittal22 pushed a commit to smittal22/azure-container-networking that referenced this pull request Jan 26, 2023
smittal22 pushed a commit to smittal22/azure-container-networking that referenced this pull request Jan 30, 2023
smittal22 pushed a commit to smittal22/azure-container-networking that referenced this pull request Feb 3, 2023
@tamilmani1989 tamilmani1989 added the cns Related to CNS. label Mar 16, 2023
@smittal22 smittal22 added the AZR AZR related PR label Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AZR AZR related PR cns Related to CNS.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants