Bug 373430 - No immediate effect of adding currently indexed dir to excludes.
Summary: No immediate effect of adding currently indexed dir to excludes.
Status: RESOLVED FIXED
Alias: None
Product: frameworks-baloo
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.28.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Pinak Ahuja
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-08 16:06 UTC by Szczepan Hołyszewski
Modified: 2019-03-20 09:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.57


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Szczepan Hołyszewski 2016-12-08 16:06:57 UTC
Steps to reproduce:

1. Reset baloo (disable indexing, remove index), reboot just in case
2. Locate or generate a directory subtree with very large number of files in your home directory
3. Start baloo indexing
4. Watch in kinfocenter for baloo to start indexing the large directory
5. Add the large directory to exclusions in systemsettings5 and apply the change.

Expected behavior:

Baloo should IMMEDIATELY abandon indexing files in the newly excluded directory and move on to indexing other directories.

Actual behavior:

Baloo continues indexing files in the newly excluded directory. The exclusion does not seem to have any immediate effect and it is unclear when or if it will take effect.
Comment 1 Szczepan Hołyszewski 2016-12-08 16:11:00 UTC
Not even stopping and restarting the indexer helps. Baloo seems to persist the batch of files scheduled for indexing and apparently does not re-filter this batch against exclusion filters upon restart.
Comment 2 Nate Graham 2017-10-27 20:07:02 UTC

*** This bug has been marked as a duplicate of bug 353874 ***
Comment 3 Nate Graham 2017-10-27 20:09:53 UTC

*** This bug has been marked as a duplicate of bug 362226 ***
Comment 4 Jamie Smith 2018-01-19 22:56:53 UTC
This is not a duplicate of either 353874 or 362226. This bug seems to describe that more work than is necessary is required to get a config change to take effect. This could possibly be solved by stopping baloo, killing the remaining baloo* processes, and restarting baloo, which should reload the config. Restarting baloo is known to sometimes leave remaining processes open thus preventing a clean restart and a complete re-evaluation of the config.
Comment 5 Nate Graham 2018-01-20 04:00:13 UTC
Thanks for the far better evaluation than I provided!
Comment 6 Nate Graham 2018-10-10 21:31:58 UTC
So would this be effectively fixed by fixing Bug 353559?
Comment 7 Jamie Smith 2018-10-10 21:44:08 UTC
(In reply to Nate Graham from comment #6)
> So would this be effectively fixed by fixing Bug 353559?

It's part of the fix. The indexer needs to be restarted whenever the config changes, which isn't currently monitored for such changes.
Comment 8 Nate Graham 2018-10-10 21:48:24 UTC
Gotcha. Thanks James!
Comment 9 Igor Poboiko 2019-03-20 09:01:21 UTC
Git commit e58804bf9eb8d507d3ef4aa8faf12d6854f5a8bc by Igor Poboiko.
Committed on 20/03/2019 at 09:01.
Pushed by poboiko into branch 'master'.

React to config updates inside indexer

Summary:
In case a config was changed, we need to:
 1. Stop the ContentIndexer (bug 373430)
 2. Remove all scheduled indexing of files that should not be indexed
 3. Check for stale index entries. Those includes documents marked for indexing, that should be removed
(because of that we need to do it inside `scheduleIndexing` before content indexing)
 4. Finally, check for unindexed files (if new files were added)

(based on {D15939}). Also note that `IndexCleaner` should clean all files, not just those inside `includeFolders`

Test Plan:
Seems to be working. But it would be nice to test it more.

 1. Add large folder to config. `baloo_file` start indexing it.
 2. Add it to exclude list. `baloo_file` stops indexing it, and removes entries from DB.
 3. Remove it from exclude list. `baloo_file` starts indexing it again.

Reviewers: #baloo, #frameworks, bruns, ngraham

Reviewed By: #baloo, ngraham

Subscribers: kde-frameworks-devel, bruns

Tags: #frameworks, #baloo

Differential Revision: https://phabricator.kde.org/D15983

M  +38   -10   src/file/fileindexscheduler.cpp
M  +1    -0    src/file/fileindexscheduler.h
M  +7    -0    src/file/indexcleaner.cpp
M  +1    -2    src/file/mainhub.cpp

https://commits.kde.org/baloo/e58804bf9eb8d507d3ef4aa8faf12d6854f5a8bc