Skip to content
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

Fault Injection: Support gRPC status code in abort fault #10323

Closed
4 tasks
vijayrajput1 opened this issue Mar 10, 2020 · 1 comment · Fixed by #10841
Closed
4 tasks

Fault Injection: Support gRPC status code in abort fault #10323

vijayrajput1 opened this issue Mar 10, 2020 · 1 comment · Fixed by #10841
Labels

Comments

@vijayrajput1
Copy link
Contributor

Description:

Currently, the Envoy fault injection filter supports the ability to inject an ‘abort’ fault into a response stream. These faults can be configured with an HTTP status code that will be returned to the client when the request is failed.

For gRPC services, the status of the request is returned to the caller in a combination of both an HTTP status code and a gRPC status code, both of which are carried in HTTP/2 headers (or trailers). Envoy’s fault injection filter doesn’t currently support a way of specifying the gRPC status code to return in case of failure, instead, it implicitly maps the HTTP status code to gRPC status code based on this. In order to simulate specific gRPC failure modes, we need to add support for configuring gRPC status code in abort fault similar to the HTTP status code.

Implementation details

A new ‘grpc_status’ field will be added to the envoy fault injection filter configuration. When this field is set and the conditions for fault injection are met, Envoy will fail the gRPC call. The upstream service will not be invoked and a ‘Trailers-Only’ gRPC response will be sent to the client. The gRPC status code in this response will be set to the configured value.

The utility function which is being used to send the fault response, already has the functionality to use a specific gRPC status code instead of deriving it based on an HTTP status code, but it is currently being passed null for the gRPC status code.

Changes required to achieve this functionality will be:

  • Introduce a new field “grpc_status” (uint32) in envoy’s fault filter configuration inside FaultAbort here
  • Read the new field and pass it to the utility function via this when set.
  • Add new unit test(s) for gRPC code here
  • Documentation update here and here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants