sourcegraph / jetbrains

Apache License 2.0
70 stars 23 forks source link

bug: com.intellij.serviceContainer.AlreadyDisposedException: Container is already disposed #2519

Open mdhender opened 1 week ago

mdhender commented 1 week ago

IDE Information

GoLand 2024.2.3 Build #GO-242.23339.24, built on September 26, 2024 Licensed to Michael Henderson Subscription is active until January 31, 2025. Runtime version: 21.0.4+13-b509.17 aarch64 (JCEF 122.1.9) VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 14.6.1 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 16000M Cores: 10 Metal Rendering is ON Registry: ide.completion.variant.limit=500 suggest.all.run.configurations.from.context=true ide.experimental.ui=true i18n.locale= terminal.new.ui=true Non-Bundled Plugins: org.asciidoctor.intellij.asciidoc (0.43.1) com.sourcegraph.jetbrains (7.0.13) com.intellij.tailwindcss (242.20224.204)

Bug Description

Editing code

Additional context

Stacktrace:


com.intellij.serviceContainer.AlreadyDisposedException: Container is already disposed
    at com.intellij.serviceContainer.ComponentManagerImplKt.throwAlreadyDisposedIfNotUnderIndicatorOrJob(ComponentManagerImpl.kt:1672)
    at com.intellij.serviceContainer.ComponentManagerImplKt.access$throwAlreadyDisposedIfNotUnderIndicatorOrJob(ComponentManagerImpl.kt:1)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:716)
    at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:690)
    at com.sourcegraph.cody.agent.CodyAgentService$Companion.getInstance(CodyAgentService.kt:227)
    at com.sourcegraph.cody.agent.CodyAgentService$Companion.withAgent$lambda$2(CodyAgentService.kt:191)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$executeOnPooledThread$1.run(AnyThreadWriteThreadingSupport.kt:134)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
    at com.intellij.util.concurrency.ContextCallable.call(ContextCallable.java:32)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:735)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:732)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:732)
    at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: com.intellij.platform.instanceContainer.internal.ContainerDisposedException: Container 'ProjectImpl@1025669989 services' was disposed
    at com.intellij.platform.instanceContainer.internal.InstanceContainerImpl.state(InstanceContainerImpl.kt:60)
    at com.intellij.platform.instanceContainer.internal.InstanceContainerImpl.state(InstanceContainerImpl.kt:40)
    at com.intellij.platform.instanceContainer.internal.InstanceContainerImpl.getInstanceHolder(InstanceContainerImpl.kt:277)
    at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:712)
    ... 15 more
Caused by: com.intellij.platform.instanceContainer.internal.DisposalTrace
    at com.intellij.platform.instanceContainer.internal.InstanceContainerImpl.dispose(InstanceContainerImpl.kt:266)
    at com.intellij.serviceContainer.ComponentManagerImpl.dispose(ComponentManagerImpl.kt:1164)
    at com.intellij.openapi.project.impl.ProjectImpl.dispose(ProjectImpl.kt:321)
    at com.intellij.openapi.util.ObjectTree.runWithTrace(ObjectTree.java:131)
    at com.intellij.openapi.util.ObjectTree.executeAll(ObjectTree.java:163)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:205)
    at com.intellij.openapi.util.Disposer.dispose(Disposer.java:193)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject$lambda$15(ProjectManagerImpl.kt:423)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$4(AnyThreadWriteThreadingSupport.kt:318)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:328)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:318)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:890)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject(ProjectManagerImpl.kt:406)
    at com.intellij.openapi.project.impl.ProjectManagerImpl.closeProject$default(ProjectManagerImpl.kt:328)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$closeAndDisposeKeepingFrame$2$1.invoke(ProjectManagerImpl.kt:981)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$closeAndDisposeKeepingFrame$2$1.invoke(ProjectManagerImpl.kt:979)
    at com.intellij.openapi.progress.CoroutinesKt.blockingContextInner(coroutines.kt:339)
    at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invokeSuspend(coroutines.kt:232)
    at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
    at com.intellij.openapi.progress.CoroutinesKt$blockingContext$2.invoke(coroutines.kt)
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:62)
    at kotlinx.coroutines.CoroutineScopeKt.coroutineScope(CoroutineScope.kt:261)
    at com.intellij.openapi.progress.CoroutinesKt.blockingContext(coroutines.kt:231)
    at com.intellij.openapi.project.impl.ProjectManagerImpl$closeAndDisposeKeepingFrame$2.invokeSuspend(ProjectManagerImpl.kt:979)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)
    at com.intellij.openapi.application.impl.DispatchedRunnable.run(DispatchedRunnable.kt:44)
    at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:229)
    at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:22)
    at com.intellij.openapi.application.TransactionGuardImpl$2.run(TransactionGuardImpl.java:211)
    at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWithImplicitRead(AnyThreadWriteThreadingSupport.kt:122)
    at com.intellij.openapi.application.impl.ApplicationImpl.runWithImplicitRead(ApplicationImpl.java:1162)
    at com.intellij.openapi.application.impl.FlushQueue.doRun(FlushQueue.java:78)
    at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:119)
    at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:41)
    at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
    at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:781)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:728)
    at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:722)
    at java.base/java.security.AccessController.doPrivileged(AccessController.java:400)
    at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java...
linear[bot] commented 1 week ago

BUGS-598 bug: com.intellij.serviceContainer.AlreadyDisposedException: Container is already disposed