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

Convert ConcurrentHashMap which does service loading to HashMap with ReentrantLock #8977

Merged
merged 3 commits into from
Jul 15, 2024

Conversation

tjquinno
Copy link
Member

@tjquinno tjquinno commented Jul 12, 2024

Description

Resolves #8967

The computeIfAbsent code applied to the SUPPLIERS ConcurrentHashMap performs service loading. Use a HashMap with an explicit guarding lock instead.

Documentation

No doc update.

@tjquinno tjquinno self-assigned this Jul 12, 2024
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jul 12, 2024
@tjquinno tjquinno requested a review from barchetta July 12, 2024 22:47
@tjquinno tjquinno merged commit 7943b17 into helidon-io:main Jul 15, 2024
12 checks passed
@tjquinno tjquinno deleted the 4.x-obs-mgr-map-lock branch July 15, 2024 19:02
barchetta pushed a commit to barchetta/helidon that referenced this pull request Jul 15, 2024
…ith `ReentrantLock` (helidon-io#8977)

* Convert ConcurrentHashMap which does service loading to HashMap with ReentrantLock

Signed-off-by: Tim Quinn <[email protected]>

* Use a RW lock

* Replace the contentious ConcurrentHashMap with a HashMap (with the lock) (which was the whole point after all)

---------

Signed-off-by: Tim Quinn <[email protected]>
barchetta added a commit that referenced this pull request Jul 16, 2024
…ith `ReentrantLock` (#8977) (#8991)

* Convert ConcurrentHashMap which does service loading to HashMap with ReentrantLock
* Use a RW lock
* Replace the contentious ConcurrentHashMap with a HashMap (with the lock) (which was the whole point after all)
---------
Signed-off-by: Tim Quinn <[email protected]>
Co-authored-by: Tim Quinn <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review ConcurrentHashMap usage in helidon-common-configurable
2 participants