VEuPathDB / vdi-service

Apache License 2.0
0 stars 0 forks source link

Double locking in a single mutex on startup in the reconciler. #302

Closed Foxcapades closed 2 months ago

Foxcapades commented 4 months ago
Exception in thread "Thread-28" java.lang.IllegalStateException: This mutex is already locked by the specified owner: vdi.component.async.Trigger@432f7c24
        at kotlinx.coroutines.sync.MutexImpl.tryLock(Mutex.kt:178)
        at kotlinx.coroutines.sync.MutexImpl.lock$suspendImpl(Mutex.kt:166)
        at kotlinx.coroutines.sync.MutexImpl.lock(Mutex.kt)
        at vdi.component.async.Trigger.isTriggered(Trigger.kt:59)
        at vdi.component.async.WorkerPool$start$1$1$1$1.invokeSuspend(WorkerPool.kt:51)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
Exception in thread "Thread-29" java.lang.IllegalStateException: This mutex is already locked by the specified owner: vdi.component.async.Trigger@44809879
        at kotlinx.coroutines.sync.MutexImpl.tryLock(Mutex.kt:178)
        at kotlinx.coroutines.sync.MutexImpl.lock$suspendImpl(Mutex.kt:166)
        at kotlinx.coroutines.sync.MutexImpl.lock(Mutex.kt)
        at vdi.component.async.Trigger.isTriggered(Trigger.kt:59)
        at vdi.component.async.WorkerPool$start$1$1$1$1.invokeSuspend(WorkerPool.kt:51)
        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
        at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:111)
        at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:99)
        at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:585)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:802)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:706)
        at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:693)
Foxcapades commented 4 months ago

This was caused by a misunderstanding and misuse of a feature that is only intended for debugging and causes exceptions to be thrown in cases that would be expected in normal operation.