I'm getting random `kotlinx.coroutines.TimeoutCanc...
# coroutines
b
I'm getting random
kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 15000 ms
(Not serring timeouts anywhere explicitly). Does anyone know how I could increase this?
m
What is timed out? Coroutines themselves don’t time out. HTTP requests do.
withTimeout { … }
calls do.
b
I see, gonna have to dig my ktor-client calls, then 😕
Although i have it configured with much larger timeout (5min)
Copy code
HttpClient {
    install(JsonFeature) {
      serializer = KotlinxSerializer(prettyJson)
    }
    install(HttpTimeout) {
      val timeout = 5 * 60 * 1000L
      requestTimeoutMillis = timeout
      connectTimeoutMillis = timeout
      socketTimeoutMillis = timeout
    }
    
  }
m
What engine are you using? Maybe it’s not set up by Ktor properly.
b
CIO on JVM
Here's a list of ktor dependencies in my project
Copy code
implementation("io.ktor:ktor-client-cio:1.4.1")
  implementation("io.ktor:ktor-client-serialization:1.4.1")
m
b
🤦‍♂️
Thanks, will change to apache
m
No, you can set the timeout. See the comment in the issue tracker
b
Oh, right
Thanks man!