Reentrant Indexing

Issue #1467 resolved
Xander Victory created an issue

I’m getting lots of these errors lately - this time was just after a bit retrieve, many class files seem to have triggered it.

It didn’t come up as one of those flashy red errors with the option to report, but I was looking at the log to see if there were any clues to why the first retrieve attempt was taking its sweet time.

SFDX project connected to a Sandbox org via SFDX/OAuth if it matters.

2019-11-08 16:24:53,029 [1554159]  ERROR - napi.project.CacheUpdateRunner - IntelliJ IDEA 2019.2.4  Build #IU-192.7142.36 
2019-11-08 16:24:53,029 [1554159]  ERROR - napi.project.CacheUpdateRunner - JDK: 11.0.4; VM: OpenJDK 64-Bit Server VM; Vendor: JetBrains s.r.o 
2019-11-08 16:24:53,029 [1554159]  ERROR - napi.project.CacheUpdateRunner - OS: Windows 10 
2019-11-08 16:24:53,030 [1554160]  ERROR - napi.project.CacheUpdateRunner - Plugin to blame: Illuminated Cloud 2 version: 2.0.9.1 
2019-11-08 16:24:53,030 [1554160]  ERROR - napi.project.CacheUpdateRunner - Last Action: IlluminatedCloud.Retrieve 
2019-11-08 16:24:53,030 [1554160]  ERROR - napi.project.CacheUpdateRunner - Error while indexing <filename was here>.cls
To reindex this file IDEA has to be restarted 
java.lang.AssertionError: Reentrant indexing
    at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1674)
    at com.intellij.util.indexing.FileBasedIndexImpl.scheduleFileForIndexing(FileBasedIndexImpl.java:1830)
    at com.intellij.util.indexing.FileBasedIndexImpl.access$2700(FileBasedIndexImpl.java:99)
    at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.lambda$null$1(FileBasedIndexImpl.java:2045)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeNonCancelableSection(CoreProgressManager.java:197)
    at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.lambda$null$2(FileBasedIndexImpl.java:2038)
    at com.intellij.util.ConcurrencyUtil.withLock(ConcurrencyUtil.java:229)
    at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.lambda$processFilesInReadAction$3(FileBasedIndexImpl.java:2036)
    at com.intellij.util.indexing.VfsEventsMerger.processChanges(VfsEventsMerger.java:95)
    at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.processFilesInReadAction(FileBasedIndexImpl.java:2035)
    at com.intellij.util.indexing.FileBasedIndexImpl$ChangedFilesCollector.ensureUpToDate(FileBasedIndexImpl.java:1988)
    at com.intellij.util.indexing.FileBasedIndexImpl.ensureUpToDate(FileBasedIndexImpl.java:710)
    at com.intellij.util.indexing.FileBasedIndexImpl.processExceptions(FileBasedIndexImpl.java:892)
    at com.intellij.util.indexing.FileBasedIndexImpl.processValueIterator(FileBasedIndexImpl.java:968)
    at com.intellij.util.indexing.FileBasedIndexImpl.processValuesInScope(FileBasedIndexImpl.java:939)
    at com.intellij.util.indexing.FileBasedIndexImpl.processValues(FileBasedIndexImpl.java:834)
    at com.intellij.util.indexing.FileBasedIndexImpl.processValues(FileBasedIndexImpl.java:822)
    at com.illuminatedcloud.intellij.index.CaseInsensitiveFilenameIndex.processFilesByName(SourceFile:111)
    at com.illuminatedcloud.intellij.index.CaseInsensitiveFilenameIndex.getFilesByName(SourceFile:151)
    at com.illuminatedcloud.intellij.index.CaseInsensitiveFilenameIndex.getFilesByName(SourceFile:98)
    at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.slowFindTypeDeclaration(SourceFile:523)
    at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.slowFindTypeDeclaration(SourceFile:491)
    at com.illuminatedcloud.intellij.psi.util.ApexDeclarationUtil.findTypeDeclaration(SourceFile:119)
    at com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationMixin.lambda$getBaseClassDeclaration$0(SourceFile:221)
    at com.intellij.psi.util.CachedValuesManager.lambda$getCachedValue$0(CachedValuesManager.java:148)
    at com.intellij.psi.impl.PsiCachedValueImpl.doCompute(PsiCachedValueImpl.java:54)
    at com.intellij.util.CachedValueBase.lambda$getValueWithLock$1(CachedValueBase.java:240)
    at com.intellij.openapi.util.RecursionManager$1.doPreventingRecursion(RecursionManager.java:113)
    at com.intellij.openapi.util.RecursionManager.doPreventingRecursion(RecursionManager.java:71)
    at com.intellij.util.CachedValueBase.getValueWithLock(CachedValueBase.java:241)
    at com.intellij.psi.impl.PsiCachedValueImpl.getValue(PsiCachedValueImpl.java:43)
    at com.intellij.util.CachedValuesManagerImpl.getCachedValueFromExHolder(CachedValuesManagerImpl.java:72)
    at com.intellij.util.CachedValuesManagerImpl.getCachedValue(CachedValuesManagerImpl.java:45)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:147)
    at com.intellij.psi.util.CachedValuesManager.getCachedValue(CachedValuesManager.java:129)
    at com.illuminatedcloud.intellij.psi.impl.ApexClassDeclarationMixin.getBaseClassDeclaration(SourceFile:196)
    at com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationStub.<init>(SourceFile:39)
    at com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationElementType.doCreateStub(SourceFile:38)
    at com.illuminatedcloud.intellij.psi.stub.ApexClassDeclarationElementType.doCreateStub(SourceFile:22)
    at com.illuminatedcloud.intellij.psi.stub.ApexDeclarationStubElementType.createStub(SourceFile:165)
    at com.illuminatedcloud.intellij.psi.stub.ApexDeclarationStubElementType.createStub(SourceFile:32)
    at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.createStub(DefaultStubBuilder.java:102)
    at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.visitNode(DefaultStubBuilder.java:77)
    at com.intellij.psi.stubs.DefaultStubBuilder$StubBuildingWalkingVisitor.buildStubTree(DefaultStubBuilder.java:72)
    at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTreeFor(DefaultStubBuilder.java:50)
    at com.intellij.psi.stubs.DefaultStubBuilder.buildStubTree(DefaultStubBuilder.java:39)
    at com.intellij.psi.stubs.StubTreeBuilder.buildStubTree(StubTreeBuilder.java:84)
    at com.intellij.psi.stubs.StubUpdatingIndex$2.lambda$computeValue$0(StubUpdatingIndex.java:130)
    at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
    at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:57)
    at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:112)
    at com.intellij.psi.stubs.StubUpdatingIndex$2.computeValue(StubUpdatingIndex.java:108)
    at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:40)
    at com.intellij.util.indexing.SingleEntryIndexer.map(SingleEntryIndexer.java:30)
    at com.intellij.util.indexing.impl.MapReduceIndex.mapInput(MapReduceIndex.java:312)
    at com.intellij.util.indexing.VfsAwareMapReduceIndex.mapInput(VfsAwareMapReduceIndex.java:109)
    at com.intellij.util.indexing.impl.MapReduceIndex.calculateUpdateData(MapReduceIndex.java:268)
    at com.intellij.util.indexing.impl.MapReduceIndex.update(MapReduceIndex.java:250)
    at com.intellij.util.indexing.FileBasedIndexImpl.updateSingleIndex(FileBasedIndexImpl.java:1680)
    at com.intellij.util.indexing.FileBasedIndexImpl.lambda$doIndexFileContent$28(FileBasedIndexImpl.java:1605)
    at com.intellij.openapi.fileTypes.impl.FileTypeManagerImpl.freezeFileTypeTemporarilyIn(FileTypeManagerImpl.java:656)
    at com.intellij.util.indexing.FileBasedIndexImpl.doIndexFileContent(FileBasedIndexImpl.java:1564)
    at com.intellij.util.indexing.FileBasedIndexImpl.indexFileContent(FileBasedIndexImpl.java:1550)
    at com.intellij.util.indexing.FileBasedIndexImpl.processRefreshedFile(FileBasedIndexImpl.java:1528)
    at com.intellij.util.indexing.FileBasedIndexProjectHandler.lambda$reindexRefreshedFiles$2(FileBasedIndexProjectHandler.java:200)
    at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$0(CacheUpdateRunner.java:219)
    at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1106)
    at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.lambda$run$1(CacheUpdateRunner.java:235)
    at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
    at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
    at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
    at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
    at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
    at com.intellij.openapi.project.CacheUpdateRunner$MyRunnable.run(CacheUpdateRunner.java:232)
    at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)

Comments (5)

  1. Scott Wells repo owner

    Yeah, I've seen this recently as well. Something changed in the plugin SDK such that index dependencies don't work quite the same anymore. I'm investigating how to make it work as it did previously on the newer versions. Hopefully I'll figure something out soon. In the interim, it seems mostly benign, albeit noisy.

  2. Xander Victory reporter

    I was noticing after this that the project in question was having some really weird issues with not finding various classes or spouting nonsense warning/error highlights. Eventually various combinations of resetting caches (both IDEA native Invalidate&Restart and IC Rebuild Caches) and regenerating the symbol table sorted that.

    Weird errors included (not all at the same time):

    • DML calls saying the wrong argument was supplied (when it was in fact a list of SObject subclasses)
    • A Trigger marking the TriggerHandler class it called as non existent (despite it being present in the local classes folder)

      • Noticed because the code coverage wasn’t showing in the sidebar of the handler, despite it being shown in the project tree as a percentage
    • Case.Id being marked as non-existent (but other fields were fine)

    • Schema.SObjectType.Case being marked non existent

    Are there any log flags I can turn on that would help diagnose this if it comes up again?

    Another thing which I’m not sure needs its own issue: One particular formula field in this Org refuses to show up in the Offline Symbol Table, despite it being downloaded in the metadata for the objects directory. Named Opportunity.Account_Owner_Id__c in case it matters.

  3. Scott Wells repo owner

    Ah, if it's causing those kinds of issues I'll accelerate my investigation. Sorry for the problems. I'll keep you posted on what I find.

  4. Log in to comment