-
Notifications
You must be signed in to change notification settings - Fork 9.2k
Description
The specs suggest it's safe to do so
- The REFUSED_STREAM error code can be included in a RST_STREAM frame to indicate that the stream is being closed prior to any processing having occurred. Any request that was sent on the reset stream can be safely retried.
https://httpwg.org/specs/rfc7540.html#Reliability
Nginx can be configured to send this on old-enough connections:
Sets the maximum number of requests that can be served through one keep-alive connection. After the maximum number of requests are made, the connection is closed.
Closing connections periodically is necessary to free per-connection memory allocations. Therefore, using too high maximum number of requests could result in excessive memory usage and not recommended.
http://nginx.org/en/docs/http/ngx_http_core_module.html#keepalive_requests
And our users are otherwise going to do it manually.
Is there an option (we may have missed) so OkHttp takes care of this transparently to the application?
https://stackoverflow.com/questions/67883227/dealing-with-okhttp-http-2-refused-stream-errors
We need a limit on how many automatic retries to attempt; maybe 1. Such retries should be on a different connection.