Guard BookmarksRunner thread use
ClosedPublic

Authored by davidedmundson on May 3 2018, 3:22 PM.

Details

Summary

Krunner::match is performed in potentially multiple overlapping threads
as a user presses each character. Qt SQL is not thread safe according to
the docs or according to the numerous reports.

It's a bit of a blind patch, ideally we should only use the database in
the thread that opened it.

This patch at least this means queries will be queued which I think will
be enough.

CCBUG: 363136

Test Plan

Restarted krunner. Still saw my firefox bookmarks

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.May 3 2018, 3:22 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMay 3 2018, 3:22 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.May 3 2018, 3:22 PM
rempt added a subscriber: rempt.May 3 2018, 3:56 PM

I cannot test it since I haven't got a system with a home-built plasma desktop, but it looks reasonable to me :-)

mart accepted this revision.May 4 2018, 11:54 AM
This revision is now accepted and ready to land.May 4 2018, 11:54 AM
This revision was automatically updated to reflect the committed changes.