Description
We are seeing infinite retries in OkHttp client (RetryAndFollowUpInterceptor).
I performed a Post Api request with connect, write and read timeout of 70 seconds. I used Charles to block the request so that it will not able to hit the server. I am expecting a SocketTimeoutException if I am blocking a request for greater than 70 sec, but I am getting Stream Reset Exception even before 70 sec (around 60 sec).
I am getting this error for the request:
at Charles I am seeing: Socket: Connection or outbound has closed
and at App Side: okhttp3.internal.http2.StreamResetException: stream was reset: REFUSED_STREAM
After getting this error at RetryAndFollowUpInterceptor, it again retries and this will continue infinitely (request is blocked at Charles)
Note: I tried many Api’s for finding this behaviour, but I found only one API.
Is there any solution to this problem?, if not then there should be some retryCount at OkHttp level where this kind of behaviour can be eliminated.