IDEA-312152: Exceptions happening during scanning should not interrupt scanning. They should be logged and ignored.

GitOrigin-RevId: a56956aae8e42a7c76cdf2297811608a8494a446
This commit is contained in:
Andrei.Kuznetsov
2023-02-02 13:53:32 +00:00
committed by intellij-monorepo-bot
parent 8ad07df317
commit 81a8fc4366
@@ -374,6 +374,15 @@ public class UnindexedFilesScanner implements MergeableQueueTask<UnindexedFilesS
provider.iterateFiles(project, collectingIterator, thisProviderDeduplicateFilter);
perProviderSink.commit();
}
catch (ProcessCanceledException pce) {
throw pce;
}
catch (Exception e) {
// CollectingIterator should skip failing files by itself. But if provider.iterateFiles cannot iterate files and throws exception,
// we want to ignore whole origin and let other origins to complete normally.
LOG.error("Error while scanning files of " + provider.getDebugName() + "\n" +
"To reindex files under this origin IDEA has to be restarted", e);
}
finally {
scanningStatistics.setNumberOfSkippedFiles(thisProviderDeduplicateFilter.getNumberOfSkippedFiles());
synchronized (allTasksFinished) {