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

Review ConcurrentHashMap usage in helidon-common-configurable #8967

Closed
spericas opened this issue Jul 12, 2024 · 1 comment · Fixed by #8977
Closed

Review ConcurrentHashMap usage in helidon-common-configurable #8967

spericas opened this issue Jul 12, 2024 · 1 comment · Fixed by #8977
Assignees
Labels
Milestone

Comments

@spericas
Copy link
Member

Problem Description

Thread pinning can occur if the mapping function passed to any of the compute methods in ConcurrentHashMap results in any I/O. The internal implementation of ConcurrentHashMap will hold a lock while the VT is parked, causing the pinning.

Note that I/O in the mapping function can be indirect: for example, using config or a service loader. Please verify that the following calls will never need I/O to complete:

ObserverManager:76

If required, re-implement the map using a traditional reentrant lock and a hash map.

@spericas spericas added performance 4.x Version 4.x labels Jul 12, 2024
@spericas spericas added this to the 4.1.0 milestone Jul 12, 2024
@tjquinno
Copy link
Member

A quick trace of the downstream code shows that the compute-if-absent function does indeed use service loading, so this will probably need to be rewritten using a lock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants