Quit baloo_file_extractor if DB transaction fails
Needs RevisionPublic

Authored by davidedmundson on Wed, Nov 27, 11:49 PM.

Details

Reviewers
bruns
ngraham
Summary

Currently I have a broken DB, the worst part is that I'm in a 100% CPU
loop.

baloo-file runs, sees some files need phase 2 extraction, and launches
the extractor. The extractor fails to update the DB which means they're
never marked as complete or failed.

baloo-file then keeps sending the same files

By having the extractor bail, it at least stops.

Test Plan

Ran baloo-file
It fails for 20 files or so (one batch) then stops

Diff Detail

Repository
R293 Baloo
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 19242
Build 19260: arc lint + arc unit
Restricted Application added projects: Frameworks, Baloo. · View Herald TranscriptWed, Nov 27, 11:49 PM
Restricted Application added subscribers: Baloo, kde-frameworks-devel. · View Herald Transcript
davidedmundson requested review of this revision.Wed, Nov 27, 11:49 PM
meven added a subscriber: meven.Thu, Nov 28, 10:25 AM
meven added inline comments.
src/file/extractor/app.cpp
145

Add a Warning/log message ? qCWarning(BALOO) << "Could not save data to DB" or similar

src/file/extractor/app.cpp
145

There's a tonne in the transaction code

meven added inline comments.Thu, Nov 28, 10:32 AM
src/file/extractor/app.cpp
145

Alright but since the program exits here, I am concerned it may not be clear enough to the user/caller as to why it exited ?
Adding a log here will add a different context.
Also QCoreApplication::exit(-1);?

New output:

_TXN: Transaction must abort, has a child, or is invalid
12:35:09.167 org.kde.baloo.engine: Baloo::PositionDB::put|Baloo::WriteTransaction::commit|Baloo::Transaction::commit PositionDB::put MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
12:35:09.171 org.kde.baloo.engine: Baloo::Transaction::commit|?baloo_file_extractor?|?baloo_file_extractor? Transaction::commit MDB_BAD_TXN: Transaction must abort, has a child, or is invalid
*20
12:35:09.172 Baloo::App::processNextFile|?baloo_file_extractor?|?baloo_file_extractor? Could not commit results. Quitting

ngraham accepted this revision.Fri, Nov 29, 5:09 PM
This revision is now accepted and ready to land.Fri, Nov 29, 5:09 PM
bruns requested changes to this revision.Fri, Nov 29, 6:00 PM

Please allow some time for reviewing ...

This revision now requires changes to proceed.Fri, Nov 29, 6:00 PM

Ack, was going to wait for you :)