poboiko created this revision. poboiko added reviewers: Baloo, Frameworks. Herald added projects: Frameworks, Baloo. Herald added a subscriber: kde-frameworks-devel. poboiko requested review of this revision.
REVISION SUMMARY Right now, a race condition might happen. Signal `FileContentIndexer::done` is connected to `FileIndexScheduler::scheduleIndexing`, which does scheduling only when there is no active threads (NB: `FileContentIndexer` is running inside one). The signal is emitted in the very end of `FileContentIndexer::run`, which should be fine. However, after `run` is finished, it also calls destructor for local `ExtractorProcess process`, which destroys `QProcess m_extractorProcess`, which itself waits for the process to finish. If `FileContentIndexer::done` signal is processed before process is finished, scheduling won't happen and baloo will be stuck in `ContentIndexing` state. (which is exactly what pointed me to this issue: `File Indexer Monitor` application showed that baloo is stuck in `ContentIndexing`, when it clearly should be `Idle`) I suggest instead to emit `FileContentIndexer::done` signal only when `ExtractorProcess` is finished. TEST PLAN I can no longer reproduce indexer being stuck in `ContentIndexing` phase. REPOSITORY R293 Baloo BRANCH wait-extractor-finish (branched from master) REVISION DETAIL https://phabricator.kde.org/D15959 AFFECTED FILES src/file/extractorprocess.cpp src/file/extractorprocess.h src/file/filecontentindexer.cpp To: poboiko, #baloo, #frameworks Cc: kde-frameworks-devel, ashaposhnikov, michaelh, astippich, spoorun, ngraham, bruns, abrahams