@@ -190,17 +190,30 @@ exiting.
190
190
For HTTP [ transports] ({{< ref "/specification/draft/basic/transports" >}}), shutdown is
191
191
indicated by closing the associated HTTP connection(s).
192
192
193
+ ## Timeouts
194
+
195
+ Implementations ** SHOULD** establish timeouts for all sent requests, to prevent hung
196
+ connections and resource exhaustion. When the request has not received a success or error
197
+ response within the timeout period, the sender ** SHOULD** issue a [ cancellation
198
+ notification] ({{< ref "utilities/cancellation" >}}) for that request and stop waiting for
199
+ a response.
200
+
201
+ SDKs and other middleware ** SHOULD** allow these timeouts to be configured on a
202
+ per-request basis.
203
+
204
+ Implementations ** MAY** choose to reset the timeout clock when receiving a [ progress
205
+ notification] ({{< ref "utilities/progress" >}}) corresponding to the request, as this
206
+ implies that work is actually happening. However, implementations ** SHOULD** always
207
+ enforce a maximum timeout, regardless of progress notifications, to limit the impact of a
208
+ misbehaving client or server.
209
+
193
210
## Error Handling
194
211
195
212
Implementations ** SHOULD** be prepared to handle these error cases:
196
213
197
214
- Protocol version mismatch
198
215
- Failure to negotiate required capabilities
199
- - Initialize request timeout
200
- - Shutdown timeout
201
-
202
- Implementations ** SHOULD** implement appropriate timeouts for all requests, to prevent
203
- hung connections and resource exhaustion.
216
+ - Request [ timeouts] ( #timeouts )
204
217
205
218
Example initialization error:
206
219
0 commit comments