[GRPC] Map to proper GRPC status codes and achieve exception handling parity with HTTP#18925
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 <karenxyr@gmail.com>
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 <karenxyr@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
|
❌ 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 <karenxyr@gmail.com>
Signed-off-by: Karen X <karenxyr@gmail.com>
|
❌ 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 <karenxyr@gmail.com>
Signed-off-by: Karen Xu <karenxyr@gmail.com>
|
❌ 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 <karenxyr@gmail.com> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <karenxyr@gmail.com> * make final Signed-off-by: Karen Xu <karenxyr@gmail.com> --------- Signed-off-by: Karen Xu <karenxyr@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com> (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 <karenxyr@gmail.com> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <karenxyr@gmail.com> * make final Signed-off-by: Karen Xu <karenxyr@gmail.com> --------- Signed-off-by: Karen Xu <karenxyr@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com> (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 <andrross@amazon.com> --------- Signed-off-by: Karen Xu <karenxyr@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Signed-off-by: Andrew Ross <andrross@amazon.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Andrew Ross <andrross@amazon.com>
… parity with HTTP (opensearch-project#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <karenxyr@gmail.com> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <karenxyr@gmail.com> * make final Signed-off-by: Karen Xu <karenxyr@gmail.com> --------- Signed-off-by: Karen Xu <karenxyr@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com>
… parity with HTTP (opensearch-project#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <karenxyr@gmail.com> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <karenxyr@gmail.com> * make final Signed-off-by: Karen Xu <karenxyr@gmail.com> --------- Signed-off-by: Karen Xu <karenxyr@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com>
… parity with HTTP (opensearch-project#18925) * [GRPC] Add proper GRPC status code and error handling Signed-off-by: Karen Xu <karenxyr@gmail.com> * rename Http to Rest, group together some convertRestToGrpcStatus codes Signed-off-by: Karen Xu <karenxyr@gmail.com> * make final Signed-off-by: Karen Xu <karenxyr@gmail.com> --------- Signed-off-by: Karen Xu <karenxyr@gmail.com> Signed-off-by: Karen X <karenxyr@gmail.com>
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.