@@ -15,9 +15,10 @@ improve the resource utilization and latency of your system.
15
15
16
16
Note that while some language APIs have the concept of a __ deadline__ , others
17
17
use the idea of a __ timeout__ . When an API asks for a deadline, you provide a
18
- point in time which the request should not go past. A timeout is the max
19
- duration of time that the request can take. For simplicity, we will only refer
20
- to deadline in this document.
18
+ point in time which the call should not go past. A timeout is the max duration
19
+ of time that the call can take. A timeout can be converted to a deadline by
20
+ adding the timeout to the current time when the application starts a call. For
21
+ simplicity, we will only refer to deadline in this document.
21
22
22
23
### Deadlines on the Client
23
24
@@ -33,24 +34,24 @@ will give up and fail the RPC with the `DEADLINE_EXCEEDED` status.
33
34
34
35
### Deadlines on the Server
35
36
36
- A server might receive requests from a client with an unrealistically short
37
+ A server might receive RPCs from a client with an unrealistically short
37
38
deadline that would not give the server enough time to ever respond in time.
38
39
This would result in the server just wasting valuable resources and in the worst
39
40
case scenario, crash the server. A gRPC server deals with this situation by
40
41
automatically cancelling a call (` CANCELLED ` status) once a deadline set by the
41
42
client has passed.
42
43
43
44
Please note that the server application is responsible for stopping any activity
44
- it has spawned to service the request . If your application is running a
45
- long-running process you should periodically check if the request that initiated
45
+ it has spawned to service the RPC . If your application is running a
46
+ long-running process you should periodically check if the RPC that initiated
46
47
it has been cancelled and if so, stop the processing.
47
48
48
49
#### Deadline Propagation
49
50
50
51
Your server might need to call another server to produce a response. In these
51
52
cases where your server also acts as a client you would want to honor the
52
53
deadline set by the original client. Automatically propagating the deadline from
53
- an incoming request to an outgoing one is supported by some gRPC
54
+ an incoming RPC to an outgoing one is supported by some gRPC
54
55
implementations. In some languages this behavior needs to be explicitly
55
56
enabled (e.g. C++) and in others it is enabled by default (e.g. Java and Go).
56
57
Using this capability lets you avoid the error-prone approach of manually
@@ -108,4 +109,4 @@ sequenceDiagram
108
109
109
110
- [ Deadlines blogpost]
110
111
111
- [ Deadlines blogpost ] : https://grpc.io/blog/deadlines/
112
+ [ Deadlines blogpost ] : https://grpc.io/blog/deadlines/
0 commit comments