-
Notifications
You must be signed in to change notification settings - Fork 260
feat: expose getHomeAzInfo api in cns to retrieve node home az infos from NMAgent #1642
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
Conversation
33fd55d to
676cbba
Compare
d68a5d4 to
4d52c08
Compare
smittal22
left a comment
There was a problem hiding this 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
left a comment
There was a problem hiding this 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.
cns/restserver/util.go
Outdated
| func (service *HTTPRestService) readNMASupportedApisCache() []string { | ||
| service.RLock() | ||
| supportedApis := service.nmaSupportedApisCache | ||
| service.RUnlock() | ||
| return supportedApis | ||
| } |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
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 |
timraymond
left a comment
There was a problem hiding this 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.
7720a87 to
6989483
Compare
timraymond
left a comment
There was a problem hiding this 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.
41ee6ec to
acafba7
Compare
remove CachedClient make homeaz caching thread periodically pulling home az from nmagent indefinitely
9a8d022 to
4cc049b
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@ashvindeodhar please leave a note explaining why this was merged bypassing checks |
|
@rbtr sorry, I added a note but seems didn't hit the 'comment' button. |
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