-
Notifications
You must be signed in to change notification settings - Fork 187
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
[BUG] Generic HTTP Actions in Java Client does not work with AwsSdk2Transport #978
Conversation
4372193
to
7f51f12
Compare
Hey @reta . I had something similar as well. But I am stuck on the request signing bit. With the standard client requests (SearchRequest and so on), the With this difference, And then the request signing gets messed up resulting in:
In the case of generic requests, we'd have to pull out the body and pass just the body to I am not sure how to get that done in a way that it is de/serialized properly. I thought I'd let you know in case you hit the same errors. |
Thanks a lot for heads up @BrendonFaleiro , one of the reasons I keep it as a draft is to verify e2e works (waiting for test AWS account to be provisioned), thanks again! |
Oh.. and one more. Before passing the bodyStream to the responseDeserializer, you will have to make a copy of the bodyStream into a new InputStream. The stream is only read from when the user gets the result, but we close the stream in the finally block of executeSync. So when the user tries to access the body, they will get In the ApacheHttpClient5Transport and RestTransport, this is achieved by copying the Entity with the stream |
That should fixed already, the stream is read fully now and kept as |
b50d185
to
d79be37
Compare
@VachaShah or I can test this quickly if you want, PR using this code into https://github.com/dblock/opensearch-java-client-demo (there are a few branches) |
That would be great @dblock , I very much stuck on the way to test it e2e due to complexity of crosssacounts, MFA and assumed roles combinations (this is the way I have access to it), not able to overcome HTTP/403 yet. |
Worked like a charm, built with this change, then used code in https://github.com/dblock/opensearch-java-client-demo/tree/generic-next.
|
8d8001c
to
246254c
Compare
…ransport Signed-off-by: Andriy Redko <[email protected]>
CHANGELOG.md
Outdated
@@ -40,6 +40,7 @@ This section is for maintaining a changelog for all breaking changes for the cli | |||
|
|||
### Fixed | |||
- Fix the deserialization of SortOptions ([#981](https://github.com/opensearch-project/opensearch-java/pull/981)) | |||
- [BUG] Generic HTTP Actions in Java Client does not work with AwsSdk2Transport ([#978](https://github.com/opensearch-project/opensearch-java/pull/978)) |
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 is really a feature I think. I would say something like "Add support for AwsSdk2Transport to generic client" and move it to features.
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 and no, I consider it as a bug to be fair because the Generic HTTP Actions implementation completely missed this transport (but covered RestClient and AHC5). This is a core transport that we committed to support.
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.
IMO it's not something that we implemented but broke, it's something that was just not implemented. If you feel strongly about this, let's remove the word "[BUG]", it's already in the fixed section.
|
Signed-off-by: Andriy Redko <[email protected]>
…ransport (#978) * [BUG] Generic HTTP Actions in Java Client does not work with AwsSdk2Transport Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]> (cherry picked from commit b8e0dad) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…ransport (#978) * [BUG] Generic HTTP Actions in Java Client does not work with AwsSdk2Transport Signed-off-by: Andriy Redko <[email protected]> * Address code review comments Signed-off-by: Andriy Redko <[email protected]> --------- Signed-off-by: Andriy Redko <[email protected]> (cherry picked from commit b8e0dad) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andriy Redko <[email protected]>
…ransport (#978) (#984) * [BUG] Generic HTTP Actions in Java Client does not work with AwsSdk2Transport * Address code review comments --------- (cherry picked from commit b8e0dad) Signed-off-by: Andriy Redko <[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>
Description
Generic HTTP Actions in Java Client does not work with AwsSdk2Transport
Issues Resolved
Closes #969
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.