@Override
  public void runActivity(@NotNull Project project) {
    ProgressManager.progress(IndexingBundle.message("progress.text.loading.indexes"));
    FileBasedIndexImpl fileBasedIndex = (FileBasedIndexImpl)FileBasedIndex.getInstance();
    PushedFilePropertiesUpdater propertiesUpdater = PushedFilePropertiesUpdater.getInstance(project);
    if (propertiesUpdater instanceof PushedFilePropertiesUpdaterImpl) {
      ((PushedFilePropertiesUpdaterImpl)propertiesUpdater).initializeProperties();
    }

    // load indexes while in dumb mode, otherwise someone from read action may hit `FileBasedIndex.getIndex` and hang (IDEA-316697)
    fileBasedIndex.loadIndexes();
    RegisteredIndexes registeredIndexes = fileBasedIndex.getRegisteredIndexes();
    if (registeredIndexes == null) return;
    boolean wasCorrupted = registeredIndexes.getWasCorrupted();

    Path projectQueueFile = getQueueFile(project);
    long vfsCreationTimestamp = ManagingFS.getInstance().getCreationTimestamp();
    ProjectDirtyFilesQueue projectDirtyFilesQueue = PersistentDirtyFilesQueue.readProjectDirtyFilesQueue(projectQueueFile, vfsCreationTimestamp);

    // Add project to various lists in read action to make sure that
    // they are not added to lists during disposing of project (in this case project may be stuck forever in those lists)
    boolean registered = ReadAction.compute(() -> {
      if (project.isDisposed()) return false;
      // done mostly for tests. In real life this is no-op, because the set was removed on project closing
      // note that disposing happens in write action, so it'll be executed after this read action
      Disposer.register(project, () -> onProjectClosing(project));

      fileBasedIndex.registerProject(project, projectDirtyFilesQueue.getFileIds());
      fileBasedIndex.registerProjectFileSets(project);
      fileBasedIndex.setLastSeenIndexInOrphanQueue(project, projectDirtyFilesQueue.getLastSeenIndexInOrphanQueue());
      fileBasedIndex.getIndexableFilesFilterHolder().onProjectOpened(project, vfsCreationTimestamp);

      myOpenProjects.add(project);
      return true;
    });

    if (!registered) return;

    // schedule dumb mode start after the read action we're currently in
    OrphanDirtyFilesQueue orphanQueue = registeredIndexes.getOrphanDirtyFilesQueue();
    Job indexesCleanupJob = scanAndIndexProjectAfterOpen(project,
                                                         orphanQueue,
                                                         fileBasedIndex.getAllDirtyFiles(null),
                                                         projectDirtyFilesQueue,
                                                         !wasCorrupted,
                                                         true,
                                                         myCoroutineScope,
                                                         "On project open",
                                                         ScanningType.FULL_ON_PROJECT_OPEN,
                                                         ScanningType.PARTIAL_ON_PROJECT_OPEN,
                                                         wasCorrupted,
                                                         InitialScanningSkipReporter.SourceOfScanning.OnProjectOpen);
    forgetProjectDirtyFilesOnCompletion(indexesCleanupJob, fileBasedIndex, project, projectDirtyFilesQueue, orphanQueue.getUntrimmedSize());
  }
@Override
  public void runActivity(@NotNull Project project)