Usage of HTTP/2 PROTOCOL_ERROR and INTERNAL_ERROR

Hi,

We maintain the HTTP client library on Apple’s platforms, and with more servers enabling HTTP/2, our error handling logic was recently brought to attention.

To my understanding, PROTOCOL_ERROR means that the other side didn’t implement the standard correctly, and INTERNAL_ERROR means something happened unexpectedly on our side (e.g. crashed). Both of the error codes should be fatal and only caused by bugs in software, so we do not attempt to retry or perform download resumption.

However, nginx is using these error codes for transfers that are too slow causing timeout, which can occur due to bad network connectivity. https://github.com/nginx/nginx/blob/master/src/http/v2/ngx_http_v2.c#L4639

My question is, should we treat PROTOCOL_ERROR and INTERNAL_ERROR as recoverable errors on the client side?

Guoye Zhang

Received on Tuesday, 3 May 2022 16:35:40 UTC