[Kde-pim] ContactSearchJob hangs for a minute

Christian Mollekopf chrigi_1 at fastmail.fm
Tue Apr 1 18:31:51 BST 2014


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
> 
> 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.

The task is supposed to be completed at line 272, but I also can't find the 
problem (it seems to work here). However, your debugoutput suggests that task-
>queries is not empty, although there is no "Enqueued search query...." 
message, so I don't understand how queries can not be empty.

If you can reliably reproduce the problem you can try the attached patch which 
immediately quits the task if it's empty instead of switching the thread first.

Cheers,
Christian
-------------- next part --------------
A non-text attachment was scrubbed...
Name: searchtaskmanager.patch
Type: text/x-patch
Size: 736 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-pim/attachments/20140401/673094a3/attachment.bin>
-------------- 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