question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"Update settings" in a big project causes "Scanning files to index" stuck forever

See original GitHub issue

Repro:

  • open up a big project (somewhat a dozen of cabal packages, ~50K LOC in Haskell)
  • Issue an “Update settings and restart REPLs” command

Expected: it finishes in about same time it was upon opening the project (a minute maybe).

Instead: it is stuck for tens of minutes, haven’t seen it finished without user interaction.

Closing project in that state produces following (maybe unrelated) exception:

stacktrace
java.lang.AssertionError: Already disposed: Project (Disposed) [REDACTED]
	at com.intellij.openapi.components.impl.ComponentManagerImpl.lambda$throwAlreadyDisposed$1(ComponentManagerImpl.java:245)
	at com.intellij.openapi.application.ReadAction.lambda$run$1(ReadAction.java:53)
	at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:977)
	at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
	at com.intellij.openapi.application.ReadAction.run(ReadAction.java:53)
	at com.intellij.openapi.components.impl.ComponentManagerImpl.throwAlreadyDisposed(ComponentManagerImpl.java:243)
	at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:236)
	at com.intellij.openapi.components.impl.ComponentManagerImpl.getPicoContainer(ComponentManagerImpl.java:46)
	at com.intellij.openapi.components.ServiceManager.doGetService(ServiceManager.java:47)
	at com.intellij.openapi.components.ServiceManager.getService(ServiceManager.java:30)
	at com.intellij.openapi.roots.impl.libraries.ProjectLibraryTable.getInstance(ProjectLibraryTable.java:10)
	at com.intellij.openapi.roots.impl.libraries.LibraryTablesRegistrarImpl.getLibraryTable(LibraryTablesRegistrarImpl.java:41)
	at com.intellij.openapi.roots.impl.libraries.LibraryTablesRegistrarImpl.getLibraryTableByLevel(LibraryTablesRegistrarImpl.java:46)
	at com.intellij.openapi.roots.impl.LibraryOrderEntryImpl.dispose(LibraryOrderEntryImpl.java:235)
	at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:48)
	at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:44)
	at com.intellij.openapi.util.objectTree.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:182)
	at com.intellij.openapi.util.objectTree.ObjectTree.executeUnregistered(ObjectTree.java:194)
	at com.intellij.openapi.util.objectTree.ObjectTree.executeAll(ObjectTree.java:147)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:129)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:125)
	at com.intellij.openapi.CompositeDisposable.dispose(CompositeDisposable.java:45)
	at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:48)
	at com.intellij.openapi.util.Disposer$1.execute(Disposer.java:44)
	at com.intellij.openapi.util.objectTree.ObjectTree.executeActionWithRecursiveGuard(ObjectTree.java:182)
	at com.intellij.openapi.util.objectTree.ObjectTree.executeUnregistered(ObjectTree.java:194)
	at com.intellij.openapi.util.objectTree.ObjectTree.executeAll(ObjectTree.java:147)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:129)
	at com.intellij.openapi.util.Disposer.dispose(Disposer.java:125)
	at com.intellij.openapi.roots.impl.RootModelImpl.dispose(RootModelImpl.java:656)
	at com.intellij.openapi.roots.impl.ModuleRootManagerImpl$1.dispose(ModuleRootManagerImpl.java:106)
	at com.intellij.openapi.roots.ModuleRootModificationUtil.updateModel(ModuleRootModificationUtil.java:148)
	at intellij.haskell.module.HaskellModuleBuilder$.removeModuleLibrary(HaskellModuleBuilder.scala:335)
	at intellij.haskell.module.HaskellModuleBuilder$.$anonfun$addPackagesAsDependenciesToModule$1(HaskellModuleBuilder.scala:295)
	at scala.collection.IndexedSeqOptimized.foreach(IndexedSeqOptimized.scala:32)
	at scala.collection.IndexedSeqOptimized.foreach$(IndexedSeqOptimized.scala:29)
	at scala.collection.mutable.ArrayOps$ofRef.foreach(ArrayOps.scala:194)
	at intellij.haskell.module.HaskellModuleBuilder$.addPackagesAsDependenciesToModule(HaskellModuleBuilder.scala:288)
	at intellij.haskell.module.HaskellModuleBuilder$.$anonfun$addLibrarySources$6(HaskellModuleBuilder.scala:262)
	at intellij.haskell.module.HaskellModuleBuilder$.$anonfun$addLibrarySources$6$adapted(HaskellModuleBuilder.scala:261)
	at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:58)
	at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:51)
	at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:47)
	at intellij.haskell.module.HaskellModuleBuilder$.$anonfun$addLibrarySources$1(HaskellModuleBuilder.scala:261)
	at intellij.haskell.module.HaskellModuleBuilder$.$anonfun$addLibrarySources$1$adapted(HaskellModuleBuilder.scala:242)
	at scala.Option.foreach(Option.scala:257)
	at intellij.haskell.module.HaskellModuleBuilder$.addLibrarySources(HaskellModuleBuilder.scala:242)
	at intellij.haskell.external.component.StackProjectManager$$anon$2.$anonfun$run$23(StackProjectManager.scala:206)
	at intellij.haskell.util.ScalaUtil$$anon$1.run(ScalaUtil.scala:36)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:314)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:745)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
rikvdkleijcommented, Dec 17, 2018

Should be fixed in next beta. It still takes some time but at least risk of deadlock should be gone.

1reaction
rikvdkleijcommented, Dec 17, 2018

Yeah, I know this issue. I thought it was fixed by waiting on smart mode before updating module settings. But apparently during updating the module settings also an index job can be started.

I have some change in mind. Hopefully that will solve it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pycharm: "scanning files to index" is taking forever
Exclude the folders you do not want to index. You can do this by right-clicking the folder you want to exclude, then choose...
Read more >
IntelliJ stuck at Scanning files to index : IDEA-266170 - YouTrack
The "Scanning files to index" message is displayed for over 15 minutes ... I've tried collecting logs but this also just hangs forever...
Read more >
Scanning files to index, out of memory. [122874775]
Trying to open large project, scanning files to index never ends and after running for a while, idea log shows out of memory...
Read more >
IntelliJ 2016.2 stuck "scanning files to index" · Issue #1479
6. My first attempt to fix this problem was to move a different .IntelliJIdea15 directory from another workstation that was an earlier version....
Read more >
Known issues with Android Studio and Android Gradle Plugin
To fix this issue, upgrade your Android 11 emulator to version 9 or higher by navigating to Tools > SDK Manager. In the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found