OkHttp long running read operation

Ready to post? :magnifying_glass_tilted_left: First, try searching for your answer.

We are using the auth0 library to call Auth0 Management APIs. We are not changing any config when using the default http client (okHttp3). However, every few calls we see the end-to-end latency to be extremely large. Below is the call graph. Any idea on how to handle this?

java.lang.Thread:run:840 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.concurrent.TaskRunner$runnable$1:run:65 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.concurrent.TaskRunner:access$runTask:42 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.concurrent.TaskRunner:runTask:116 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.concurrent.TaskQueue$execute$1:runOnce:98 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.http2.Http2Connection$ReaderRunnable:invoke:609 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.http2.Http2Connection$ReaderRunnable:invoke:618 (method time = 0 ms, total time = 237255 ms)
okhttp3.internal.http2.Http2Reader:nextFrame:89 (method time = 0 ms, total time = 237255 ms)
okio.RealBufferedSource:require:202 (method time = 0 ms, total time = 237255 ms)
okio.RealBufferedSource:request:209 (method time = 0 ms, total time = 237255 ms)
okio.AsyncTimeout$source$1:read:128 (method time = 0 ms, total time = 237255 ms)
okio.InputStreamSource:read:93 (method time = 237255 ms, total time = 237255 ms)

Hi @narayanak,

Thanks for your question.

This is my first time encountering this behavior. The logs you shared indicate that it timed out after almost 4 minutes, which is quite a long time.

I checked our status page, and there don’t seem to be any incidents that might cause this latency.

And because this seems to happen only every few calls, the issue might originate from something else.

How frequently are you making these calls? Could you please share an example of a call with example data?

And, do you see any relevant logs in Auth0 about the read call?

Thanks,
Rueben