We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
When a coroutine with start = CoroutineStart.LAZY is cancelled before ever starting, DebugProbes seems to keep them around forever.
start = CoroutineStart.LAZY
DebugProbes
Example:
import kotlinx.coroutines.* import kotlinx.coroutines.debug.DebugProbes object Main { @JvmStatic fun main(args: Array<String>): Unit = runBlocking { DebugProbes.enableCreationStackTraces = false DebugProbes.install() val job = launch(start = CoroutineStart.LAZY) { delay(Long.MAX_VALUE) } job.invokeOnCompletion { println("job stopped: ${it?.message}") } job.cancel("foo") job.join() DebugProbes.dumpCoroutines(System.out) } }
Output:
job stopped: foo Coroutines dump 2020/10/10 13:52:45 Coroutine LazyStandaloneCoroutine{Cancelled}@26b3fd41, state: CREATED (Coroutine creation stacktrace) Process finished with exit code 0
Note that if that lazy job is ever started, it gets correctly removed.
Example with start = CoroutineStart.DEFAULT:
start = CoroutineStart.DEFAULT
import kotlinx.coroutines.* import kotlinx.coroutines.runBlocking object Main { @JvmStatic fun main(args: Array<String>): Unit = runBlocking { DebugProbes.enableCreationStackTraces = false DebugProbes.install() val job = launch { delay(Long.MAX_VALUE) } job.invokeOnCompletion { println("job stopped: ${it?.message}") } job.cancel("foo") job.join() DebugProbes.dumpCoroutines(System.out) } }
job stopped: foo Coroutines dump 2020/10/10 13:52:29 Process finished with exit code 0
The text was updated successfully, but these errors were encountered:
Cleanup lazy coroutines that have been cancelled but not yet garbage …
979f3ab
…collected Fixes #2294
993c192
qwwdfsad
No branches or pull requests
When a coroutine with
start = CoroutineStart.LAZY
is cancelled before ever starting,DebugProbes
seems to keep them around forever.Example:
Output:
Note that if that lazy job is ever started, it gets correctly removed.
Example with
start = CoroutineStart.DEFAULT
:Output:
The text was updated successfully, but these errors were encountered: