RunBlocking in coroutine
Reports runBlocking builders that can be reached from coroutines.
Coroutines share threads for execution. When a runBlocking builder is called from a coroutine it blocks the underlying thread and prevents other coroutines from using this resource. This can result in performance issues and in bad cases thread starvation.
It provides a potential callstack from coroutine primitive (suspend function or builder) to runBlocking builder.
Example:
Potential solution:
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
RunBlocking- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
Use the explore functions with overrides option to configure analysis for virtual functions:
Use the No option to skip analysis for a function with overrides.
Use the Yes, excluding overrides option to only explore the function in the defined callee type.
Use the Yes, including overrides option to explore the function and all overrides.
Inspection options
Here you can find the description of settings available for the RunBlocking in coroutine inspection, and the reference of their default values.
- Explore functions with overrides
Default value:
Yes, excluding overridesOther available settings:
No
Yes, including overrides
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: |