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

how to detect slow coroutine #1566

Open
vipcxj opened this issue Dec 4, 2024 · 0 comments
Open

how to detect slow coroutine #1566

vipcxj opened this issue Dec 4, 2024 · 0 comments

Comments

@vipcxj
Copy link

vipcxj commented Dec 4, 2024

Is there a way to detect a particularly slow coroutine. It is always known that a coroutine should not block. However, once a project is complex enough, the chances of erroneous blocking of a coroutine are inevitable. I need a way to detect where asynchronous code is incorrectly introducing blocking. The detection criterion is that the execution time exceeds a certain value.
I hope this approach provides two pieces of information

  1. Duration of the slow coroutine
  2. Source code location of the slow coroutine

After some research, I found out that customizing an executor should enable the task of finding the slow coroutine to some extent. However, this approach makes it difficult to get information about the source location of the coroutine. Is there a better, less intrusive method?

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

No branches or pull requests

1 participant