Skip to content

Infinite Retry happening (No cap on Okhttp retry count) #7530

Open
@Yogesh-1206

Description

@Yogesh-1206

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)

Screenshot 2022-11-24 at 2 32 09 PM

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugBug in existing codeneeds infoMore information needed from reporter

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions