[FileIndexerConfig] skip invalid entries from included/excludedFolders
Needs RevisionPublic

Authored by poboiko on Jul 17 2019, 9:18 AM.

Details

Reviewers
bruns
ngraham
Group Reviewers
Baloo
Summary

It is possible to create an invalid entry inside includedFolders, for example:
by creating some folder, adding it to config and then deleting it.

If such entry appears inside config, for example, IndexCleaner will go mad:
it calculates the id of each entry from the config (which for non-existent
file resolves to 0), and then calls tr.removeRecursively(0, shouldDelete).
Which is not something what we want, as 0 can be misintepreted as tree root.

This patch omits invalid entries when building folders cache inside config,
and adds unit test for such case

Test Plan

ctest

Diff Detail

Repository
R293 Baloo
Branch
removed-include-folder (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 14032
Build 14050: arc lint + arc unit
poboiko created this revision.Jul 17 2019, 9:18 AM
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptJul 17 2019, 9:18 AM
poboiko requested review of this revision.Jul 17 2019, 9:18 AM
bruns added a comment.Jul 17 2019, 2:48 PM

The correct fix is to check the returned/calculated ID in the IndexCleaner, otherwise its racy.

bruns requested changes to this revision.Jul 17 2019, 2:49 PM
This revision now requires changes to proceed.Jul 17 2019, 2:49 PM

The correct fix is to check the returned/calculated ID in the IndexCleaner, otherwise its racy.

I think both can be implemented.
I had in mind the case when folder was removed while baloo wasn't running, and thus encountering this issue on the next run.

poboiko edited the summary of this revision. (Show Details)Jul 19 2019, 11:42 AM