D22502: [FileIndexerConfig] skip invalid entries from included/excludedFolders

2019-07-19 Thread Igor Poboiko
poboiko edited the summary of this revision.

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D22502

To: poboiko, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, LeGast00n, sbergeron, fbampaloukas, domson, 
ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams


D22502: [FileIndexerConfig] skip invalid entries from included/excludedFolders

2019-07-17 Thread Igor Poboiko
poboiko added a comment.


  In D22502#496812 , @bruns wrote:
  
  > 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.

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D22502

To: poboiko, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, LeGast00n, sbergeron, fbampaloukas, domson, 
ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams


D22502: [FileIndexerConfig] skip invalid entries from included/excludedFolders

2019-07-17 Thread Stefan Brüns
bruns requested changes to this revision.
This revision now requires changes to proceed.

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D22502

To: poboiko, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, LeGast00n, sbergeron, fbampaloukas, domson, 
ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams


D22502: [FileIndexerConfig] skip invalid entries from included/excludedFolders

2019-07-17 Thread Stefan Brüns
bruns added a comment.


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

REPOSITORY
  R293 Baloo

REVISION DETAIL
  https://phabricator.kde.org/D22502

To: poboiko, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, LeGast00n, sbergeron, fbampaloukas, domson, 
ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams


D22502: [FileIndexerConfig] skip invalid entries from included/excludedFolders

2019-07-17 Thread Igor Poboiko
poboiko created this revision.
poboiko added reviewers: Baloo, bruns, ngraham.
Herald added projects: Frameworks, Baloo.
poboiko requested review of this revision.

REVISION 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 either crashes due to assert (if it's a debug build) or silently runs
  `removeRecursively` for the whole tree.
  
  This patch omits invalid entries when building folders cache inside config,
  and adds unit test for such case

TEST PLAN
  ctest

REPOSITORY
  R293 Baloo

BRANCH
  removed-include-folder (branched from master)

REVISION DETAIL
  https://phabricator.kde.org/D22502

AFFECTED FILES
  autotests/unit/file/fileindexerconfigtest.cpp
  autotests/unit/file/fileindexerconfigtest.h
  src/file/fileindexerconfig.cpp

To: poboiko, #baloo, bruns, ngraham
Cc: kde-frameworks-devel, LeGast00n, sbergeron, fbampaloukas, domson, 
ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams