grpc / grpc-java

The Java gRPC implementation. HTTP/2 based RPC
https://grpc.io/docs/languages/java/
Apache License 2.0
11.48k stars 3.85k forks source link

Disable automatic deadline propagation #11690

Closed javiertoja closed 6 days ago

javiertoja commented 1 week ago

Hello,

I have a process that involves a synchronous call chain between 3 systems, A->b->C.

I'm wondering if there is a way to disable the deadline propatagion of grpc-java as the documentation says that this is enabled by default. For a specific business process I don't want that if the deadline from the request A->B, is reached, that it stops the processing on B, due to the dealine being propagated to the call B->C.

In this specific usecase, if the system B cannot answer in the expected time, we would like to allow it continue its execution, and do not cascade the deadline to other calls like B->C

ejona86 commented 1 week ago

You want to adjust the Context. It is mentioned in the cancellation example. The example shows a quick snippet of how to do a single RPC with a different Context, but you can run as much code as you want with the different Context. So all the logic doing B→C could run without cancellation.