We have some issue with okhttp retrying request. Most of our clients are receiving too much of this kind of exception according to our crash reporting logs.
What they complain about is that data is uploaded to the server but mobile still shows as not uploaded. I have researched a bit and found that okHttp is retrying requests on connection failure and guess it is related to this topic. I can't create a case while debugging the app. I have tried to connect to 10.10.10.1, it is getting socket timeout, but it seems that okhttp doesn't retry this request. It just returns on this line if (!streamAllocation.hasMoreRoutes()) return false;
(okhttp v3.12.1). I can't see any logs on retrying in logcat or stetho. How to reproduce this case? Should okHttp retry in this case? Will disabling retry help in this case?
Per this article https://medium.com/inloopx/okhttp-is-quietly-retrying-requests-is-your-api-ready-19489ef35ace
You will not get notified about these silent retries. The server can receive multiple requests even though you made only a single request.