-
Notifications
You must be signed in to change notification settings - Fork 282
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
Prevent flaky behavior when determining if an request will be executed on the current node. #3066
Prevent flaky behavior when determining if an request will be executed on the current node. #3066
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3066 +/- ##
============================================
- Coverage 62.54% 62.36% -0.18%
+ Complexity 3361 3347 -14
============================================
Files 254 254
Lines 19744 19741 -3
Branches 3334 3334
============================================
- Hits 12349 12312 -37
- Misses 5768 5793 +25
- Partials 1627 1636 +9
|
src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Peter Nied <[email protected]>
a286662
to
871c58f
Compare
@@ -130,7 +130,8 @@ public <T extends TransportResponse> void sendRequestDecorate( | |||
String action, | |||
TransportRequest request, | |||
TransportRequestOptions options, | |||
TransportResponseHandler<T> handler | |||
TransportResponseHandler<T> handler, | |||
DiscoveryNode localNode |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this a parameter for sendRequestDecorate
makes more sense IMO
@@ -165,7 +162,7 @@ public void testSendRequestDecorate() { | |||
assertEquals(threadPool.getThreadContext().getHeader(ConfigConstants.OPENDISTRO_SECURITY_USER_HEADER), null); | |||
|
|||
// isSameNodeRequest = false | |||
securityInterceptor.sendRequestDecorate(sender, connection2, action, request, options, handler); | |||
securityInterceptor.sendRequestDecorate(sender, connection2, action, request, options, handler, otherNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is now fully deterministic 👍
### Description Remove static reference/initialization of localNode variable inside security plugin, to fix `No user found..` errors caused due to mismatching localNode values in test. Signed-off-by: Peter Nied <[email protected]> Co-authored-by: Peter Nied <[email protected]> (cherry picked from commit cca77be)
Backport cca77be from #3066 Co-authored-by: Darshit Chanpura <[email protected]>
### Description Remove static reference/initialization of localNode variable inside security plugin, to fix `No user found..` errors caused due to mismatching localNode values in test. Signed-off-by: Peter Nied <[email protected]> Co-authored-by: Peter Nied <[email protected]> (cherry picked from commit cca77be) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Backport cca77be from #3066. 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> Co-authored-by: Peter Nied <[email protected]>
Description
Remove static reference/initialization of localNode variable inside security plugin, to fix
No user found..
errors caused due to mismatching localNode values in test.Solve CI flakiness introduced in: #2765
Check List
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.