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

HDDS-11764. Fix initiating DocumentBuilderFactory performance problem. #7462

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

juncevich
Copy link
Contributor

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.

@adoroszlai adoroszlai marked this pull request as draft November 20, 2024 20:09
Copy link
Contributor

@adoroszlai adoroszlai left a 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

Comment on lines 62 to 70
NodeSchemaManager cachedInstance = cache.get(schemaFile);
if (cachedInstance == null) {
instance = new NodeSchemaManager();
instance.init(schemaFile);
cache.put(schemaFile, instance);
return instance;
} else {
return cachedInstance;
}
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, will fix.

@adoroszlai
Copy link
Contributor

Looking at stack trace in the screenshot attached to HDDS-11764, I think this is fixed by #6434. OzoneManager.getClusterMap() no longer creates new NetworkTopologyManager.

@juncevich
Copy link
Contributor Author

#6434

Yep. It looks like you're right.

@juncevich
Copy link
Contributor Author

Will test and this PR close if the problem will solved.

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