[Kde-pim] ContactSearchJob hangs for a minute

Christian Mollekopf mollekopf at kolabsys.com
Tue Apr 1 17:15:10 BST 2014


On Tuesday 01 April 2014 17.18:26 Daniel Vrátil wrote:
> 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 disabled remote search for email for a reason (search was pretty much 
unusably slow), and you just pointed out that there are no resources providing 
remote search for contacts. For me that counts as untested ;-)

So, I'd be in favor to not run code that doesn't yet serve any purpose and 
potentially has bugs. Especially since the bugs will only be exposed once a 
resource implements the search interface for the contacts but potentially 
destabilize search for all resources.

So, I'm in favor of disabling it, but leave the decision up to you as 
maintainer of the server search code.

Cheers,
Christian

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

_______________________________________________
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