-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-33122 Clean up the mechanism for modifying the component config #19362
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Gavin Halliday <[email protected]>
Signed-off-by: Gavin Halliday <[email protected]>
Signed-off-by: Gavin Halliday <[email protected]>
Signed-off-by: Gavin Halliday <[email protected]>
Signed-off-by: Gavin Halliday <[email protected]>
Jira Issue: https://hpccsystems.atlassian.net//browse/HPCC-33122 Jirabot Action Result: |
Signed-off-by: Gavin Halliday <[email protected]>
Signed-off-by: Gavin Halliday <[email protected]>
Signed-off-by: Gavin Halliday <[email protected]>
I think ready for initial review, but I need to go back and review it as well. |
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.
@ghalliday - looks good, a couple of questions.
dali/base/dafdesc.cpp
Outdated
{ | ||
CriticalBlock block(storageCS); | ||
Owned<IPropertyTree> globalConfig = getGlobalConfig(); | ||
Owned<IPropertyTree> storage = globalConfig->getPropTree("storage"); | ||
Owned<IPropertyTree> storage = newGlobalConfiguration->getPropTree("storage"); |
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.
trivial: could be an unlinked item, i.e. could be IPropertyTree *storage = newGlobalConfiguration->queryPropTree("storage");
only mentioning, because I looked at the code and the fact it was linked made me wonder if it was necessary for some reason.
system/jlib/jptree.cpp
Outdated
ConfigUpdateFunc notifyFunc = notifyConfigUpdates[notifyFuncId]; | ||
notifyFunc(config, global); | ||
} | ||
refreshConfiguration(true, false); |
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.
trivial: 2nd param 'avoidClone' while not used if firstTime=true - slightly clearer that not/doesn't need to clone if passed avoidClone=true here?
system/jlib/jptree.cpp
Outdated
CriticalBlock b(notifyFuncCS); | ||
//Ensure all modifications to the config take place before the config is updated, and the monitoring/caching functions are called. | ||
for (auto & modifyFunc : modifyConfigUpdates) | ||
modifyFunc.second(newComponentConfiguration, newGlobalConfiguration); |
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.
minor: I might be inclined to put these 2 lines in a 'executeModifyCallbacks' and rename executeCallbacks to 'executeNotifyCallbacks'
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.
and, as with the current executeCallbacks, would it be better to wrap the calls with try/catch blocks, in case one of them throws?
@@ -805,7 +806,7 @@ class CRoxieDaliHelper : implements IRoxieDaliHelper, public CInterface | |||
waitToConnect -= delay; | |||
} | |||
} | |||
initializeStorageGroups(daliHelper->connected()); | |||
initializeStoragePlanes(daliHelper->connected(), false); // This can be called while queries are running - so is not thread safe |
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.
not new, but it looks like connectToDali is called every time a query dll is loaded, unconditionally,
meaning there is excessive calling of loading/refreshing the configuration (may be slowing the init time down as well).
Should this only be called by when it 1st time and/or when it actually reconnects to Dali ?
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.
Created HPCC-33198 to look at that issue.
Signed-off-by: Gavin Halliday <[email protected]>
See changes following review in last commit |
Type of change:
Checklist:
Smoketest:
Testing: