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

Fix NPE and add additional graceful error handling #2687

Merged
merged 5 commits into from
Apr 17, 2023

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Apr 17, 2023

Description

This PR adds graceful error handling in a cache miss scenario where the error is swallowed. Additional tests have been added to verify the new functionality.

Testing

See associated unit tests added

Check List

  • New functionality includes testing
  • 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: Craig Perkins <[email protected]>
Copy link
Contributor

@stephen-crawford stephen-crawford left a comment

Choose a reason for hiding this comment

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

Thank you Craig.

RyanL1997
RyanL1997 previously approved these changes Apr 17, 2023
@RyanL1997 RyanL1997 added backport 2.7 backport to 2.7 branch backport 1.x backport to 1.x branch backport 1.3 backport to 1.3 branch backport 2.x backport to 2.x branch labels Apr 17, 2023
Signed-off-by: Craig Perkins <[email protected]>
@cwperks cwperks dismissed stale reviews from RyanL1997 and stephen-crawford via 8f4905a April 17, 2023 16:42
@codecov-commenter
Copy link

codecov-commenter commented Apr 17, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.44%. Comparing base (bbd43ec) to head (8f4905a).
Report is 680 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #2687      +/-   ##
============================================
+ Coverage     61.38%   61.44%   +0.06%     
- Complexity     3383     3385       +2     
============================================
  Files           269      270       +1     
  Lines         18668    18694      +26     
  Branches       3279     3279              
============================================
+ Hits          11459    11487      +28     
+ Misses         5613     5611       -2     
  Partials       1596     1596              
Files with missing lines Coverage Δ
.../opensearch/security/OpenSearchSecurityPlugin.java 80.16% <100.00%> (+0.12%) ⬆️
...ecurity/support/GuardedSearchOperationWrapper.java 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

@cwperks cwperks merged commit ed4df62 into opensearch-project:main Apr 17, 2023
@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.x 1.x
# Navigate to the new working tree
cd .worktrees/backport-1.x
# Create a new branch
git switch --create backport/backport-2687-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ed4df62fcb5a3c54869db70dcaf0283472751591
# Push it to GitHub
git push --set-upstream origin backport/backport-2687-to-1.x
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-2687-to-1.x.

@opensearch-trigger-bot
Copy link
Contributor

The backport to 1.3 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-1.3 1.3
# Navigate to the new working tree
cd .worktrees/backport-1.3
# Create a new branch
git switch --create backport/backport-2687-to-1.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 ed4df62fcb5a3c54869db70dcaf0283472751591
# Push it to GitHub
git push --set-upstream origin backport/backport-2687-to-1.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-1.3

Then, create a pull request where the base branch is 1.3 and the compare/head branch is backport/backport-2687-to-1.3.

opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 17, 2023
* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ed4df62)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 17, 2023
* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ed4df62)
RyanL1997 pushed a commit that referenced this pull request Apr 17, 2023
* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit ed4df62)
cwperks pushed a commit that referenced this pull request Apr 18, 2023
* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>
sebastianmichalski pushed a commit to sebastianmichalski/security that referenced this pull request Apr 19, 2023
…t#2687)

* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 20, 2023
…t#2687)

* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Maciej Mierzwa <[email protected]>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Apr 27, 2023
…t#2687)

* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Maciej Mierzwa <[email protected]>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Jun 13, 2023
…t#2687)

* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Maciej Mierzwa <[email protected]>
MaciejMierzwa pushed a commit to MaciejMierzwa/security that referenced this pull request Jun 13, 2023
…t#2687)

* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Maciej Mierzwa <[email protected]>
samuelcostae pushed a commit to samuelcostae/security that referenced this pull request Jun 19, 2023
…t#2687)

* Fix NPE and add additional graceful error handling

Signed-off-by: Craig Perkins <[email protected]>

* Add new lines at end of file

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Remove unused import

Signed-off-by: Craig Perkins <[email protected]>

* volatile to final

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Sam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.x backport to 1.x branch backport 1.3 backport to 1.3 branch backport 2.x backport to 2.x branch backport 2.7 backport to 2.7 branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants