christophsturm
03/17/2022, 10:36 AMwithTimeout
is it possible to get a stacktrace of the thread where the timeout occurred when it occurred?Sam
03/17/2022, 10:59 AMTimeoutCancellationException
you should get a stacktrace but I don't know if it'll be a very useful oneSam
03/17/2022, 11:00 AMSam
03/17/2022, 11:00 AMSam
03/17/2022, 11:01 AMchristophsturm
03/17/2022, 11:34 AMchristophsturm
03/17/2022, 11:35 AMThread.getAllStackTraces()
and find the correct threadchristophsturm
03/17/2022, 11:36 AMwithTimeout
linechristophsturm
03/17/2022, 11:37 AMCaused by: kotlinx.coroutines.TimeoutCancellationException: Timed out waiting for 40000 ms
at kotlinx.coroutines.TimeoutKt.TimeoutCancellationException(Timeout.kt:184)
at kotlinx.coroutines.TimeoutCoroutine.run(Timeout.kt:154)
Sam
03/17/2022, 11:42 AMSam
03/17/2022, 11:43 AMwithTimeout
, it doesn't provide any control over the exception that gets thrownSam
03/17/2022, 11:44 AMThe timeout event in withTimeout is asynchronous with respect to the code running in its block and may happen at any time, even right before the return from inside of the timeout block.
Sam
03/17/2022, 11:44 AMSam
03/17/2022, 11:46 AMchristophsturm
03/17/2022, 12:00 PMchristophsturm
03/17/2022, 12:01 PMJoffrey
03/17/2022, 12:34 PMwithTimeout
's body you should have a CancellationException
with the correct stacktrace if I remember correctlychristophsturm
03/17/2022, 12:37 PM