I have a chunk of code that makes HTTP calls using Ktor HttpClient. This code has a loop that will try these requests multiple times if there are failures. Usually few times a day I get exceptions like this:
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 15000 ms
at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:116)
at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:86)
at kotlinx.coroutines.EventLoopImplBase$DelayedRunnableTask.run(EventLoop.common.kt:492)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:271)
at kotlinx.coroutines.DefaultExecutor.run(DefaultExecutor.kt:68)
at java.base/java.lang.Thread.run(Thread.java:834)
I did some google searches and found that TimeoutCancellationException
get thrown from withTimeout()
methods (https://kotlinlang.org/docs/reference/coroutines/cancellation-and-timeouts.html), but I’m not making these calls.
Is there anyway to understand what code defines these timeout parameters?
This is running in a server side JVM using Kotlin 1.3.70 and Ktor 1.3.1.