[Kde-pim] ContactSearchJob hangs for a minute

Daniel Vrátil dvratil at redhat.com
Tue Apr 1 16:18:26 BST 2014


On Tuesday 01 of April 2014 06:46:55 Christian Mollekopf wrote:
> On Monday 31 March 2014 23.33:29 David Faure wrote:
> > Often, when I send a mail, the composer window locks up for a minute,
> > waiting on ContactSearchJob::exec().
> > 
> > After discussing it with Vishesh he showed me that the problem isn't
> > baloo,
> > and further use of gdb shows that the issue is in akonadiserver.
> > 
> > There is indeed a lot of logic in
> > akonadi/server/src/search/searchtaskmanager.cpp
> > so I will remember to be careful before blaming baloo in the future! :)
> > 
> > For now I reverted my wrong changes to that file, but the initial problem
> > is still there:
> > 
> > 
> > Executing search "kmail2-592826184-SearchSession"
> > 22:58:14 akonadiserver(838) recursiveContactTermMapping: "email"
> > QVariant(QString, "vhanda at kde.org") 22:58:14 akonadiserver(838)
> > SearchPlugin::search: "{ "limit" : 1, "term" : { "$and" : [ { "$or" : [ {
> > "collection" : { "$ct" : "5602" } }, { "collection" : { "$ct" : "5621" }
> > },
> > { "collection" : { "$ct" : "6022" } }, { "collection" : { "$ct" : "6036" }
> > }, { "collection" : { "$ct" : "6078" } }, { "collection" : { "$ct" :
> > "5646"
> > } }, { "collection" : { "$ct" : "751" } }, { "collection" : { "$ct" :
> > "751"
> > } }, { "collection" : { "$ct" : "5646" } }, { "collection" : { "$ct" :
> > "5602" } }, { "collection" : { "$ct" : "5621" } }, { "collection" : {
> > "$ct"
> > 
> > : "5756" } }, { "collection" : { "$ct" : "5756" } }, { "collection" : {
> > 
> > "$ct" : "5757" } }, { "collection" : { "$ct" : "5757" } }, { "collection"
> > :
> > { "$ct" : "6022" } }, { "collection" : { "$ct" : "6023" } }, {
> > "collection"
> > 
> > : { "$ct" : "6023" } }, { "collection" : { "$ct" : "6036" } }, {
> > 
> > "collection" : { "$ct" : "6078" } }, { "collection" : { "$ct" : "6079" }
> > },
> > { "collection" : { "$ct" : "6079" } } ] }, { "$or" : [ { "email" : "vhand
> > a at kde.org" } ] } ] }, "type" : [ "Contact" ] }"
> > 22:58:14 akonadiserver(838) Baloo::XapianSearchStore::exec:
> > Xapian::Query(((C5602:(pos=1,wqf=4) OR C5621:(pos=1,wqf=4) OR
> > C6022:(pos=1,wqf=4) OR C6036:(pos=1,wqf=4) OR C6078:(pos=1,wqf=4) OR
> > C5646:(pos=1,wqf=4) OR C751:(pos=1,wqf=4) OR C5756:(pos=1,wqf=2) OR
> > C5757:(pos=1,wqf=4) OR C6023:(pos=1,wqf=2) OR C6079:(pos=1,wqf=2)) AND
> > (vhanda:(pos=1) PHRASE 3 kde:(pos=2) PHRASE 3 org:(pos=3)))) 22:58:14
> > akonadiserver(838) Baloo::XapianSearchStore::exec: Query Generation 1
> > 22:58:14 akonadiserver(838) Baloo::XapianSearchStore::exec: Exec 0 msecs
> > 22:58:14 akonadiserver(838) SearchPlugin::search: Got 0 results
> > Resource "akonadi_kolabproxy_resource" does not implement Search
> > interface,
> > skipping Resource "akonadi_vcard_resource_0" does not implement Search
> > interface, skipping Resource "akonadi_kdeaccounts_resource_0" does not
> > implement Search interface, skipping Resource
> > "akonadi_kolabproxy_resource"
> > does not implement Search interface, skipping Resource
> > "akonadi_kolabproxy_resource" does not implement Search interface,
> > skipping
> > Resource "akonadi_kolabproxy_resource" does not implement Search
> > interface,
> > skipping Resource "akonadi_contacts_resource_5" does not implement Search
> > interface, skipping Resource "akonadi_contacts_resource_5" does not
> > implement Search interface, skipping Resource "akonadi_vcard_resource_2"
> > does not implement Search interface, skipping Resource
> > "akonadi_contacts_resource_6" does not implement Search interface,
> > skipping
> > Resource "akonadi_contacts_resource_6" does not implement Search
> > interface,
> > skipping Search task "searchUpdate-1396299437" available!
> > Search loop is waiting, will wake again in 60000 ms

This ^^^ is the problem. We don't have any contacts resources that have 
server-side search support, so when a task is pushed into the searchLoop, it 
is not dispatched to any resource that would deliver results (pushResults) and 
thus remove the task from the loop and finish it, so the task only gets 
finished after it times out after a minute.

A solution is not to append the tash to mTasklist in addTask() if there are no 
queries.

> > 
> > And then it waits for 1 minute indeed.... Shouldn't this task be marked as
> > complete and be processed right away? By now we got all our results, no?
> > There is some logic error in that code somewhere, but I can't find it.
> 
> We should set remote search to disabled by default in ItemSearchJob, as this
> code is not really tested, and also not required currently.
> Obviously there is also an issue in searchtaskmanager that we should fix
> nevertheless.

I don't think that the code is not tested and I'm not in favor of disabling 
the remote search...

> I'll look into this this evening, but you can already work around this by
> disabling remote search if you want.

See above :-)

Dan

> 
> Cheers,
> Christian
> 
> _______________________________________________
> KDE PIM mailing list kde-pim at kde.org
> https://mail.kde.org/mailman/listinfo/kde-pim
> KDE PIM home page at http://pim.kde.org/

-- 
Daniel Vrátil | dvratil at redhat.com | dvratil on #kde-devel, #kontact, #akonadi
KDE Desktop Team
Associate Software Engineer, Red Hat, Inc.

GPG Key: 0xC59D614F6F4AE348
Fingerprint: 4EC1 86E3 C54E 0B39 5FDD B5FB C59D 614F 6F4A E348
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140401/06f9f2d6/attachment.sig>
-------------- next part --------------
_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list