Skip to content
New issue

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

UI freezes with QS #7149

Open
dkashyn-sfdc opened this issue Dec 10, 2024 · 1 comment · Fixed by #7153
Open

UI freezes with QS #7149

dkashyn-sfdc opened this issue Dec 10, 2024 · 1 comment · Fixed by #7153
Assignees
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: bug

Comments

@dkashyn-sfdc
Copy link
Contributor

Description of the bug:

image

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

No response

Which Intellij IDE are you using? Please provide the specific version.

IJ 243.22562.59

What programming languages and tools are you using? Please provide specific versions.

No response

What Bazel plugin version are you using?

2024.11.19.0.1-api-version-243

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

"AWT-EventQueue-0" prio=0 tid=0x0 nid=0x0 runnable
     java.lang.Thread.State: RUNNABLE

	at com.intellij.platform.instanceContainer.internal.InstanceContainerState.getByClass(InstanceContainerState.kt)
	at com.intellij.platform.instanceContainer.internal.InstanceContainerImpl.getInstanceHolder(InstanceContainerImpl.kt:99)
	at com.intellij.serviceContainer.ComponentManagerImpl.doGetService(ComponentManagerImpl.kt:717)
	at com.intellij.serviceContainer.ComponentManagerImpl.getService(ComponentManagerImpl.kt:695)
	at com.intellij.workspaceModel.ide.legacyBridge.SourceRootTypeRegistry$Companion.getInstance(SourceRootTypeRegistry.kt:14)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.SourceFolderBridge.getSourceRootType(ContentFolderBridge.kt:111)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.SourceFolderBridge.<init>(ContentFolderBridge.kt:39)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ContentEntryBridge.sourceFolders_delegate$lambda$3(ContentEntryBridge.kt:25)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ContentEntryBridge$$Lambda/0x00007f255826f588.invoke(Unknown Source)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ContentEntryBridge.getSourceFolders(ContentEntryBridge.kt:24)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ContentEntryBridge.getSourceFolders(ContentEntryBridge.kt:35)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ModifiableContentEntryBridge.addSourceFolder(ModifiableContentEntryBridge.kt:76)
	at com.intellij.workspaceModel.ide.impl.legacyBridge.module.roots.ModifiableContentEntryBridge.addSourceFolder(ModifiableContentEntryBridge.kt:256)
	at com.google.idea.blaze.base.qsync.ProjectUpdater.lambda$updateProjectModel$1(ProjectUpdater.java:179)
	at com.google.idea.blaze.base.qsync.ProjectUpdater$$Lambda/0x00007f2559570480.run(Unknown Source)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction$lambda$5(AnyThreadWriteThreadingSupport.kt:379)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$$Lambda/0x00007f255843e6a8.compute(Unknown Source)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:389)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteAction(AnyThreadWriteThreadingSupport.kt:379)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteAction(ApplicationImpl.java:896)
	at com.google.idea.common.util.Transactions.lambda$submitWriteActionTransactionAndWait$2(Transactions.java:41)
	at com.google.idea.common.util.Transactions$$Lambda/0x00007f2558d58220.run(Unknown Source)
	at com.intellij.openapi.application.TransactionGuardImpl.runWithWritingAllowed(TransactionGuardImpl.java:236)
	at com.intellij.openapi.application.TransactionGuardImpl.access$100(TransactionGuardImpl.java:25)
	at com.intellij.openapi.application.TransactionGuardImpl$1.run(TransactionGuardImpl.java:198)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread$lambda$2(AnyThreadWriteThreadingSupport.kt:217)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport$$Lambda/0x00007f2557a11440.compute(Unknown Source)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runIntendedWriteActionOnCurrentThread(AnyThreadWriteThreadingSupport.kt:216)
	at com.intellij.openapi.application.impl.ApplicationImpl.runIntendedWriteActionOnCurrentThread(ApplicationImpl.java:842)
	at com.intellij.openapi.application.impl.ApplicationImpl$2.run(ApplicationImpl.java:421)
	at com.intellij.openapi.application.impl.AppImplKt.rethrowExceptions$lambda$2(appImpl.kt:57)
	at com.intellij.openapi.application.impl.AppImplKt$$Lambda/0x00007f255852c680.run(Unknown Source)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at com.intellij.util.concurrency.ChildContext$runInChildContext$1.invoke(propagation.kt:101)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:107)
	at com.intellij.util.concurrency.ChildContext.runInChildContext(propagation.kt:101)
	at com.intellij.util.concurrency.ContextRunnable.run(ContextRunnable.java:27)
	at com.intellij.openapi.application.impl.AppImplKt.rethrowExceptions$lambda$3(appImpl.kt:68)
	at com.intellij.openapi.application.impl.AppImplKt$$Lambda/0x00007f255852d638.run(Unknown Source)
	at com.intellij.openapi.application.impl.LaterInvocator$1.run(LaterInvocator.java:102)
	at com.intellij.openapi.application.impl.FlushQueue.runNextEvent(FlushQueue.java:117)
	at com.intellij.openapi.application.impl.FlushQueue.flushNow(FlushQueue.java:43)
	at com.intellij.openapi.application.impl.FlushQueue$$Lambda/0x00007f25575ed160.run(Unknown Source)
	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 [email protected]/java.security.AccessController.executePrivileged(AccessController.java:778)
	at [email protected]/java.security.AccessController.doPrivileged(AccessController.java:400)
	at [email protected]/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:750)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.kt:675)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.kt:573)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16$lambda$15(IdeEventQueue.kt:355)
	at com.intellij.ide.IdeEventQueue$$Lambda/0x00007f2557c45470.compute(Unknown Source)
	at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:857)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18$lambda$17$lambda$16(IdeEventQueue.kt:354)
	at com.intellij.ide.IdeEventQueue$$Lambda/0x00007f25577ce888.invoke(Unknown Source)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2$lambda$1(IdeEventQueue.kt:1045)
	at com.intellij.ide.IdeEventQueueKt$$Lambda/0x00007f25577ca6a0.run(Unknown Source)
	at com.intellij.openapi.application.WriteIntentReadAction.lambda$run$0(WriteIntentReadAction.java:24)
	at com.intellij.openapi.application.WriteIntentReadAction$$Lambda/0x00007f25577d0000.compute(Unknown Source)
	at com.intellij.openapi.application.impl.AnyThreadWriteThreadingSupport.runWriteIntentReadAction(AnyThreadWriteThreadingSupport.kt:128)
	at com.intellij.openapi.application.impl.ApplicationImpl.runWriteIntentReadAction(ApplicationImpl.java:916)
	at com.intellij.openapi.application.WriteIntentReadAction.compute(WriteIntentReadAction.java:55)
	at com.intellij.openapi.application.WriteIntentReadAction.run(WriteIntentReadAction.java:23)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$2(IdeEventQueue.kt:1045)
	at com.intellij.ide.IdeEventQueueKt$$Lambda/0x00007f25577cf398.invoke(Unknown Source)
	at com.intellij.ide.IdeEventQueueKt.performActivity$lambda$3(IdeEventQueue.kt:1054)
	at com.intellij.ide.IdeEventQueueKt$$Lambda/0x00007f25577ca220.run(Unknown Source)
	at com.intellij.openapi.application.TransactionGuardImpl.performActivity(TransactionGuardImpl.java:109)
	at com.intellij.ide.IdeEventQueueKt.performActivity(IdeEventQueue.kt:1054)
	at com.intellij.ide.IdeEventQueue.dispatchEvent$lambda$18(IdeEventQueue.kt:349)
	at com.intellij.ide.IdeEventQueue$$Lambda/0x00007f25577c7a38.run(Unknown Source)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.kt:395)
	at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:207)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
	at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
	at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
	at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:92)
@dkashyn-sfdc dkashyn-sfdc added awaiting-maintainer Awaiting review from Bazel team on issues type: bug labels Dec 10, 2024
@sellophane sellophane self-assigned this Dec 10, 2024
@sgowroji sgowroji added the product: IntelliJ IntelliJ plugin label Dec 10, 2024
tpasternak pushed a commit to tpasternak/bazel-intellij that referenced this issue Dec 10, 2024
@github-project-automation github-project-automation bot moved this from Untriaged to Done in Bazel IntelliJ Plugin Dec 11, 2024
@tpasternak tpasternak reopened this Dec 11, 2024
@github-project-automation github-project-automation bot moved this from Done to Untriaged in Bazel IntelliJ Plugin Dec 11, 2024
@tpasternak
Copy link
Contributor

The freeze is caused by the fact that the whole updateProjectModel method is called on EDT. It consists of a lot of read actions that could be executed under readAndWriteAction, but we would have to reorganize it, so all writes are called as the last statements there. Currently there are structure is like that

  1. syncPlugin.updateProjectSettingsForQuerySync - this requires write permissions
  2. a lot of expensive reads and data processing
  3. models.commit - this requires write permissions too.

Probably we could move all the read actions to the beginning under readAndWriteAction and then move syncPlugin.updateProjectSettingsForQuerySync and models.commit to the end and run after writeAction but I don't have time to investigate it, unfortunately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-maintainer Awaiting review from Bazel team on issues product: IntelliJ IntelliJ plugin type: bug
Projects
Status: Untriaged
Development

Successfully merging a pull request may close this issue.

6 participants