Markus Mattinen

Results comments of Markus Mattinen

@swankjesse Here's a test case that seems to always trigger a timeout: ``` java @Test public void unexpectedRequestTimeout() throws Exception { final MockWebServer server = new MockWebServer(); server.setBodyLimit(0); server.enqueue(new MockResponse().setBody("done.").throttleBody(1024,...

Thanks for running the test and confirming the behaviour @dave-r12. Not entirely sure what you mean by "this seems right" - the behaviour that you observed is definitely not what...

I see. I suppose there is not much that can be done about the read timeouts. That only leaves the write timeout problem then. To reproduce it more reliably, increase...

You're right, it's not so much about chunked encoding as it is about doing the socket.write() in smaller parts. Test cases (first one fails, second one passes): ``` java @Test...

Is the behaviour in the last two test cases expected? Since I'm using Retrofit I can't actually use the solution that makes the latter test case pass by writing into...

So why does it seem to make a difference in my test case above? Am I doing something else differently?

Yes, I did notice that behaviour with the throttling, which is why I have used 1000 or even 100 as the throttling interval. That should not be the difference here....

The relevant Okio code seems to be here: https://github.com/square/okio/blob/master/okio/src/main/java/okio/AsyncTimeout.java#L155 The actual socket timeout exception that gets thrown is caused by this: https://github.com/square/okio/blob/master/okio/src/main/java/okio/Okio.java#L221

From Okio documentation (http://square.github.io/okio/1.x/okio/okio/Timeout.html): Timeouts specify the maximum time to wait for a single operation to complete. Timeouts are typically used to detect problems like network partitions. For example, if...