-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[GRPC] Map to proper GRPC status codes and achieve exception handling parity with HTTP #18925
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
Conversation
|
❌ Gradle check result for 159a844: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 945bb64: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for dd84c75: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Karen Xu <[email protected]>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #18925 +/- ##
============================================
+ Coverage 72.88% 72.90% +0.02%
- Complexity 69300 69333 +33
============================================
Files 5642 5644 +2
Lines 318640 318707 +67
Branches 46108 46119 +11
============================================
+ Hits 232237 232355 +118
+ Misses 67566 67525 -41
+ Partials 18837 18827 -10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
...ansport-grpc/src/main/java/org/opensearch/transport/grpc/util/HttpToGrpcStatusConverter.java
Outdated
Show resolved
Hide resolved
...ansport-grpc/src/main/java/org/opensearch/transport/grpc/util/HttpToGrpcStatusConverter.java
Show resolved
Hide resolved
...ansport-grpc/src/main/java/org/opensearch/transport/grpc/util/HttpToGrpcStatusConverter.java
Show resolved
Hide resolved
...rt-grpc/src/main/java/org/opensearch/transport/grpc/listeners/BulkRequestActionListener.java
Show resolved
Hide resolved
...transport-grpc/src/main/java/org/opensearch/transport/grpc/services/DocumentServiceImpl.java
Show resolved
Hide resolved
Signed-off-by: Karen Xu <[email protected]>
Signed-off-by: Karen X <[email protected]>
|
❌ Gradle check result for 6b93cb6: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
❌ Gradle check result for 6b93cb6: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Karen X <[email protected]>
Signed-off-by: Karen X <[email protected]>
|
❌ Gradle check result for 5ff1ad2: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Signed-off-by: Karen X <[email protected]>
Signed-off-by: Karen Xu <[email protected]>
|
❌ Gradle check result for 5dcf5c7: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
… parity with HTTP (#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <[email protected]> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <[email protected]> * make final Signed-off-by: Karen Xu <[email protected]> --------- Signed-off-by: Karen Xu <[email protected]> Signed-off-by: Karen X <[email protected]> (cherry picked from commit be8bbe1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
…eption handling parity with HTTP (#18990) * [GRPC] Map to proper GRPC status codes and achieve exception handling parity with HTTP (#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <[email protected]> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <[email protected]> * make final Signed-off-by: Karen Xu <[email protected]> --------- Signed-off-by: Karen Xu <[email protected]> Signed-off-by: Karen X <[email protected]> (cherry picked from commit be8bbe1) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> * Add entry to release notes Signed-off-by: Andrew Ross <[email protected]> --------- Signed-off-by: Karen Xu <[email protected]> Signed-off-by: Karen X <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andrew Ross <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrew Ross <[email protected]>
… parity with HTTP (opensearch-project#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <[email protected]> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <[email protected]> * make final Signed-off-by: Karen Xu <[email protected]> --------- Signed-off-by: Karen Xu <[email protected]> Signed-off-by: Karen X <[email protected]>
… parity with HTTP (opensearch-project#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <[email protected]> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <[email protected]> * make final Signed-off-by: Karen Xu <[email protected]> --------- Signed-off-by: Karen Xu <[email protected]> Signed-off-by: Karen X <[email protected]>
… parity with HTTP (opensearch-project#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <[email protected]> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <[email protected]> * make final Signed-off-by: Karen Xu <[email protected]> --------- Signed-off-by: Karen Xu <[email protected]> Signed-off-by: Karen X <[email protected]>
Description
Improve transport-grpc error handling, to use proper GRPC conventions, but also maintain parity with HTTP APIs.
Detailed Examples
1. Remove HTTP status codes from protobuf messages
ResponseItem { status: 201 // HTTP Created status code }ResponseItem { status: 0 // gRPC OK status code }2. Return proper GRPC status codes instead of all showing as GRPC.INTERNAL
3. Use constants for error messages so both HTTP and gRPC now use identical error messages from
ExceptionsHelper.ErrorMessages4. Wrap error messages in the same way as HTTP
ExceptionsHelper.summaryMessage()// Both APIs: "OpenSearchException[Index not found]"Related Issues
Resolves #18926
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.