question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `GrpcCircuitBreakerRule`

See original GitHub issue

If a CircuitBreakerRule is built for gRPC clients, users might want to get grpc-status to decide whether a call is a success or not. Normally, grpc-status exists in the HTTP trailers of a response. However, if a call is failed, it could be in the HTTP headers of a trailers-only response. It is a transport-level protocol specification and many users may not know the details.

If we add GrpcCircuitBreakerRule which inherits the existing CircuitBreakerRule and add onGrpcStatus(), users will be able to use circuit breaker with gRPC clients more easily.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ikhooncommented, Oct 21, 2022

it could be even better if the GrpcCircuitBreakerRule has a method onGrpcTrailers(grpcTrailers: HttpHeaders)

Agreed! In addition to onGrpcStatus(), onGrpcTrailers() would be a good extension method for GrpcCircuitBreakerRule and GrpcRetryRule.

1reaction
Lincongcommented, Oct 21, 2022

Generally I think adding GrpcCircuitBreakerRule with a onGrpcStatus method is a great idea.

However, it could be even better if the GrpcCircuitBreakerRule has a method onGrpcTrailers(grpcTrailers: HttpHeaders) where grpcTrailers is “trailers” in the context of gRPC. Specifically, grpcTrailers could be either HTTP headers if the response is “trailers-only” or HTTP trailers if the response has 3 parts (HTTP headers, body, and HTTP trailers).

This onGrpcTrailers(grpcTrailers: HttpHeaders) is more generally useful because users get access to the whole gRPC trailer which must contain gRPC status (as promised by the gRPC protocol specification). Another way to think about it would be: what if users want to set up their circuit-break conditions upon other information stored in gRPC trailers other than just gRPC status?

Let me know what you think. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Circuit Breaker with gRPC - Stack Overflow
I solved my problem by implementing the circuit-breaker on my client. I used the sentinel library. To react on exceptions ratio for example ......
Read more >
gRPC - Circuit Breaker recommendations · Issue #7281 - GitHub
A circuit breaker in gRPC would just be a client interceptor (and potentially a server interceptor, depending on how the breaking is designed)....
Read more >
Building a gRPC Client Standard to Boost Reliability and ...
This is done by configuring the parameters of the clients' timeouts, retry strategy, and circuit breakers. If set correctly, timeouts are ...
Read more >
Introducing gRPC to our Hotels.com Platform — Part 1 - Medium
gRPC allows you to set deadlines (and you should always do so). However, you might still need a Circuit Breaker for connection back-off...
Read more >
Setting up Resilience4j Circuit Breaker for Grpc Java Client
This article explains how to set up Resilience4j circuit breaker to work with a grpc client set up with grpc-spring-boot-starter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found