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

Protect config object from concurrent modification issues #3945

Merged
merged 2 commits into from
Jan 17, 2024

Conversation

peternied
Copy link
Member

Description

Protect config object from concurrent modification issues

We've had rare reports of modification exceptions from customers around the config objects. Using a lock object to protect the internal collection from modification on other threads and changing the behavoir of the getter to pass a copy of the collection instead of direct collection references.

Issues Resolved

Check List

  • New functionality includes testing
  • New functionality has been documented
  • 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.

We've had rare reports of modification exceptions from customers around
the config objects.  Using a lock object to protect the internal
collection from modification on other threads and changing the behavoir
of the getter to pass a copy of the collection instead of direct
collection references.

- Resolves opensearch-project#3404

Signed-off-by: Peter Nied <[email protected]>
@peternied peternied force-pushed the concurrent-safe-config branch from 0c7fe39 to efdf2a0 Compare January 12, 2024 20:43
Signed-off-by: Peter Nied <[email protected]>
Copy link

codecov bot commented Jan 12, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (b905999) 65.41% compared to head (bb0dd89) 65.45%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3945      +/-   ##
==========================================
+ Coverage   65.41%   65.45%   +0.03%     
==========================================
  Files         298      298              
  Lines       21219    21239      +20     
  Branches     3457     3460       +3     
==========================================
+ Hits        13880    13901      +21     
  Misses       5617     5617              
+ Partials     1722     1721       -1     
Files Coverage Δ
...ecurityconf/impl/SecurityDynamicConfiguration.java 79.67% <82.92%> (+3.94%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

Looks good. left a nit.

@peternied peternied merged commit 6047d66 into opensearch-project:main Jan 17, 2024
82 checks passed
@peternied peternied deleted the concurrent-safe-config branch January 17, 2024 17:42
@peternied peternied added the backport 2.x backport to 2.x branch label Jan 17, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 17, 2024
Signed-off-by: Peter Nied <[email protected]>
(cherry picked from commit 6047d66)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
peternied pushed a commit that referenced this pull request Jan 17, 2024
…ues (#3956)

Backport 6047d66 from #3945.

Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dlin2028 pushed a commit to dlin2028/security that referenced this pull request May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x backport to 2.x branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] ConcurrentModificationException in security package
3 participants