-
Notifications
You must be signed in to change notification settings - Fork 502
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
HDDS-11764. Fix initiating DocumentBuilderFactory performance problem. #7462
base: master
Are you sure you want to change the base?
Conversation
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.
Thanks @juncevich for working on this. Please check CI run for failures: https://github.com/juncevich/ozone/actions/runs/11940547308
NodeSchemaManager cachedInstance = cache.get(schemaFile); | ||
if (cachedInstance == null) { | ||
instance = new NodeSchemaManager(); | ||
instance.init(schemaFile); | ||
cache.put(schemaFile, instance); | ||
return instance; | ||
} else { | ||
return cachedInstance; | ||
} |
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.
This is not thread-safe. Use cache.computeIfAbsent()
if NodeSchemaManager.init()
has no side-effects.
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.
Thanks, will fix.
Looking at stack trace in the screenshot attached to HDDS-11764, I think this is fixed by #6434. |
Yep. It looks like you're right. |
Will test and this PR close if the problem will solved. |
HDDS-11764. Fix initiating DocumentBuilderFactory performance problem.
Cache initiating DocumentBuilderFactory and NodeSchemaManager to ip
Link to Jira task: HDDS-11764
Patch tested only by performance tests.