so apparently user of my program encounters deadlock issues rnadomly in my program, apparently in a area of the code where i use coroutines and channels
but the worst is.. i cannot manage to reproduce it with the same input data on my hardware
would i be able to use visualvm to see where it is blocking itself?
i also did not quite rule out that ktor-client-cio is not at fault, but again no idea how to test that
🧵
v
Vsevolod Tolstopyatov [JB]
09/19/2018, 4:55 PM
Visiualvm won’t help you here.
For local development we have a prototype of async stracktraces + jstack — https://github.com/Kotlin/kotlinx.coroutines/pull/572
But you have not so many options when you are already deadlocked. Akka, erlang and other reactive systems have similar problem: you can instrument everything to properly trace dependencies, but you cannot do it when problem already happened.
I used to play with JVM serviceability API (openjdk only), but it’s far from complete: https://github.com/qwwdfsad/coroutines-dump-agentMaybe (I’m not yet sure) this agent can be a dynamic jstack analogue for coroutines
n
Nikky
09/19/2018, 5:30 PM
well i could log when entering / leaving a function, then visualize that and see where it got stuck
just no clue which program could visualize that for me or maybe even solve it with annotations
v
Vsevolod Tolstopyatov [JB]
09/20/2018, 9:03 AM
But if you can log everything, maybe you can just run with debug agent enabled?