Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make coroutines debugging, specifically coroutines dumping, ready for production #1379

Closed
qwwdfsad opened this issue Jul 25, 2019 · 0 comments

Comments

@qwwdfsad
Copy link
Member

On the page https://github.com/Kotlin/kotlinx.coroutines/tree/master/kotlinx-coroutines-debug, there is still the warning:

Do not use this module in production environment and do not rely on the format of the data produced by DebugProbes.

It would be great if one core aspect of this facility could be made ready for production, which is the ability to dump the active coroutines. Given that coroutines can suspend, a thread dump is not enough to show what is happening (or not happening) inside a production system. Threads could simply be suspended waiting for an active coroutine to resume, but currently there is no way to obtain this information.

As mentioned by @Vsevolod.Tolstopyatov in Slack, there is a facility to dump coroutines via kill -5 when the debug agent is installed (https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-debug/src/AgentPremain.kt#L12). I would love to be able to do kill -5 on a production system to dump coroutines.

Like thread dumps, it should also be possible to obtain the dump via JMX. This would be analagous to the java.lang.Threading.dumpAllThreads() JMX operation provided by ThreadMXBean. However, a JMX facility could easily be implemented at a later time.

Original: https://youtrack.jetbrains.com/issue/KT-32953

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant