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

[2.x] Avoid ConcurrentModificationException for User class fields #5084

Merged
merged 2 commits into from
Feb 4, 2025

Conversation

shikharj05
Copy link
Contributor

@shikharj05 shikharj05 commented Feb 4, 2025

Description

[Describe what this change achieves]

By switching to CopyOnWriteArraySet and ConcurrentHashMap, we get lock-free reads, safe iteration without explicit synchronization.

However, CopyOnWriteArraySet can lead to memory overhead - should be minimal as updates/writes are expected to be lower compared to reads.

Issues Resolved

[List any issues this PR will resolve]
#4441

Is this a backport? If so, please add backport PR # and/or commits #, and remove backport-failed label from the original PR.

Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here

Testing

[Please provide details of testing done: unit testing, integration testing and manual testing]

tested locally.

Check List

  • New functionality includes testing
  • [NA] New functionality has been documented
  • [NA] New Roles/Permissions have a corresponding security dashboards plugin PR
  • [NA] API changes companion pull request created
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
@shikharj05 shikharj05 requested a review from nibix February 4, 2025 09:39
Copy link

codecov bot commented Feb 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.11%. Comparing base (f088dd4) to head (7980c01).
Report is 3 commits behind head on 2.x.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##              2.x    #5084      +/-   ##
==========================================
- Coverage   68.14%   68.11%   -0.03%     
==========================================
  Files         347      347              
  Lines       24552    24555       +3     
  Branches     4070     4070              
==========================================
- Hits        16731    16726       -5     
- Misses       5898     5903       +5     
- Partials     1923     1926       +3     
Files with missing lines Coverage Δ
...pensearch/security/securityconf/ConfigModelV7.java 68.10% <100.00%> (+0.18%) ⬆️

... and 6 files with indirect coverage changes

@cwperks cwperks merged commit 05e56ec into opensearch-project:2.x Feb 4, 2025
81 of 82 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 4, 2025
)

Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
(cherry picked from commit 05e56ec)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@cwperks cwperks added the v3.0.0 label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants