-
Notifications
You must be signed in to change notification settings - Fork 143
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
Add support of .opensearch-knn-model as system index to transport actions #847
Add support of .opensearch-knn-model as system index to transport actions #847
Conversation
Signed-off-by: Martin Gaievski <[email protected]>
e9c7c1c
to
32dc7f8
Compare
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## main #847 +/- ##
============================================
+ Coverage 85.11% 85.17% +0.05%
- Complexity 1081 1086 +5
============================================
Files 151 152 +1
Lines 4394 4404 +10
Branches 390 393 +3
============================================
+ Hits 3740 3751 +11
+ Misses 477 474 -3
- Partials 177 179 +2
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
/** | ||
* Class abstracts execution of runnable or function in specific context | ||
*/ | ||
public class TaskRunner { |
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.
can we rename this class to ThreadContextHelper?
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.
yes, this makes more sense. I could came up with a good name yesterday so took the straightforward one. I'll push a commit soon
Signed-off-by: Martin Gaievski <[email protected]>
@@ -219,21 +218,14 @@ public void create(ActionListener<CreateIndexResponse> actionListener) throws IO | |||
if (isCreated()) { | |||
return; | |||
} | |||
runWithStashedThreadContext(() -> { |
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.
why we need to remove this from runWithStashedThreadContext?
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.
we do context stashing at the transport action level, which is a caller for this method, so keeping this functionality here is redundant.
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.
Thanks this make sense
final IndexRequestBuilder indexRequestBuilder = ModelDao.runWithStashedThreadContext( | ||
() -> client.prepareIndex(MODEL_INDEX_NAME) | ||
); | ||
IndexRequestBuilder indexRequestBuilder = client.prepareIndex(MODEL_INDEX_NAME); |
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.
same as above.
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.
we do context stashing at the transport action level, keeping this functionality here is redundant
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.
Thanks this make sense
@@ -369,12 +361,12 @@ private ActionListener<IndexResponse> getUpdateModelMetadataListener( | |||
|
|||
@SneakyThrows |
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.
sneakythrows are not supposed to be used in src files. it is mainly for tests. please remove this.
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.
ack
Signed-off-by: Martin Gaievski <[email protected]>
616e8e3
to
b1cfaef
Compare
…ions (#847) * Add thread context stashing to transport actions Signed-off-by: Martin Gaievski <[email protected]> (cherry picked from commit 1b6fd48)
…ions (#847) * Add thread context stashing to transport actions Signed-off-by: Martin Gaievski <[email protected]> (cherry picked from commit 1b6fd48)
…ions (#847) (#849) * Add thread context stashing to transport actions Signed-off-by: Martin Gaievski <[email protected]> (cherry picked from commit 1b6fd48) Co-authored-by: Martin Gaievski <[email protected]>
…ions (#847) (#848) * Add thread context stashing to transport actions Signed-off-by: Martin Gaievski <[email protected]> (cherry picked from commit 1b6fd48) Co-authored-by: Martin Gaievski <[email protected]>
…port actions (opensearch-project#847)" This reverts commit 1b6fd48. Signed-off-by: John Mazanec <[email protected]>
…#859) Revert "Add support of .opensearch-knn-model as system index to transport actions (#847)" Makes minor fixes to stashed thread context for calls to the model system index. In general, only direct calls to the system index should be wrapped in the stashed context. Signed-off-by: John Mazanec <[email protected]>
…#859) Revert "Add support of .opensearch-knn-model as system index to transport actions (#847)" Makes minor fixes to stashed thread context for calls to the model system index. In general, only direct calls to the system index should be wrapped in the stashed context. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit 11c6616)
…#859) Revert "Add support of .opensearch-knn-model as system index to transport actions (#847)" Makes minor fixes to stashed thread context for calls to the model system index. In general, only direct calls to the system index should be wrapped in the stashed context. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit 11c6616)
…#863) Revert "Add support of .opensearch-knn-model as system index to transport actions (#847)" Makes minor fixes to stashed thread context for calls to the model system index. In general, only direct calls to the system index should be wrapped in the stashed context. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit 11c6616)
…#862) Revert "Add support of .opensearch-knn-model as system index to transport actions (#847)" Makes minor fixes to stashed thread context for calls to the model system index. In general, only direct calls to the system index should be wrapped in the stashed context. Signed-off-by: John Mazanec <[email protected]> (cherry picked from commit 11c6616)
Description
We need to stash thread context in transport actions in addition to ModelDao to address all integ tests failures like in log below. This change compliments previous PR #827
Issues Resolved
opensearch-project/security#2265
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.