You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Errors are caught on firebase, and the number seems to be high .I caught >500 of these exceptions on firebase.
kotlinx-coroutines-core-jvm version = 1.5.0
Caused by java.lang.IllegalStateException
Job UndispatchedCoroutine{Cancelled}@df1b0f1 is already complete or completing, but is being completed with CompletedExceptionally[kotlinx.coroutines.JobCancellationException: Parent job is Cancelling; job=UndispatchedCoroutine{Cancelled}@df1b0f1]
kotlinx.coroutines.JobSupport.makeCompletingOnce$kotlinx_coroutines_core (JobSupport.kt:831)
kotlinx.coroutines.AbstractCoroutine.resumeWith (AbstractCoroutine.kt:100)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:46)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)
Fatal Exception: kotlinx.coroutines.CoroutinesInternalError
Fatal exception in coroutines machinery for AwaitContinuation(DispatchedContinuation[Dispatchers.IO, Continuation at MyAppPackageName.ComponentLoader$download$3.invokeSuspend(ComponentLoader.kt)@5c61a13]){Cancelled}@efd1450. Please read KDoc to 'handleFatalException' method and report this incident to maintainers
kotlinx.coroutines.DispatchedTask.handleFatalException (DispatchedTask.kt:144)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:115)
kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely (CoroutineScheduler.kt:571)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask (CoroutineScheduler.kt:750)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker (CoroutineScheduler.kt:678)
kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run (CoroutineScheduler.kt:665)
Provide a Reproducer
object ComponentLoader {
privateval coroutineScope:CoroutineScope by lazy {
CoroutineScope(SupervisorJob() +Dispatchers.IO)
}
privateval downloadMutexLock =Mutex()
privateval downloadingMap =ConcurrentHashMap<String, Job>()
suspendfunloadAllTemplates(
componentId:String,
waitDownload:Boolean = true
): Map<String, ByteArray>? {
return withContext(Dispatchers.IO) {
if (waitDownload) {
try {
downloadingMap[componentId]?.join()
} catch (cancelExc:CancellationException) {
throw cancelExc
}
}
getLocal(componentId)?.let {
return@withContext it
}
return@withContext null
}
}
@JvmStatic
suspendfundownload(
componentId:String,
cdnUrl:String
): SyncResult= withContext(Dispatchers.IO) {
val deferred:Deferred<SyncResult>
downloadMutexLock.withLock {
if (downloadingMap.containsKey(componentId)) {
val msg ="component $componentId is downloading..."return@withContext SyncResult.Error(componentId, Exception(msg))
}
if (checkLocalCacheAvailable(componentId, cdnUrl)) {
return@withContext SyncResult.Success(componentId, false)
}
deferred = async(context =Dispatchers.IO, start =CoroutineStart.LAZY) {
return@async downloadInternal(componentId, cdnUrl)
}
downloadingMap[componentId] = deferred
}
val result = deferred.await()
downloadingMap.remove(componentId)
return@withContext result
}
privatesuspendfundownloadInternal(componentId:String, cdnUrl:String): SyncResult {
/** * one download logic...*/return result
}
privatesuspendfuncheckLocalCacheAvailable(
componentId:String,
cdnUrl:String
) = withContext(Dispatchers.IO) {
/** * Check there is a cache locally*/returntrueorfalse
}
}
The text was updated successfully, but these errors were encountered:
Describe the bug
Errors are caught on firebase, and the number seems to be high .I caught >500 of these exceptions on firebase.
kotlinx-coroutines-core-jvm version = 1.5.0
log:
other log
Provide a Reproducer
The text was updated successfully, but these errors were encountered: