https://kotlinlang.org logo
#coroutines
Title
# coroutines
r

rocketraman

12/04/2023, 9:55 PM
In what situation would
scope.isActive == true
but
DebugProbes.printScope(scope)
return
Unit
and
scope.coroutineContext[Job]?.join()
fail to unsuspend? I have a supervisor
Job
in which I believe all its children are finished (
join
on each child job unsuspends), but a call to
scope.coroutineContext[Job]?.join()
does not unsuspend. The job is in
active
state.
DebugProbes.printScope(scope)
returns
Unit
, and
DebugProbes.dumpCoroutines()
shows no coroutines of interest. This is executing within
runTest
.
Ah, a Ktor
SelectorManager
needed to be closed as well.
The weird thing is if I try to close it
Copy code
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
  selectorManager.close()
}
the hang still happens, but taking it out of the
withContext
works.