After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 670191 - IndividualAggregator::is-quiescent is never set to TRUE
IndividualAggregator::is-quiescent is never set to TRUE
Status: RESOLVED FIXED
Product: folks
Classification: Platform
Component: general
git master
Other Linux
: Normal blocker
: Unset
Assigned To: folks-maint
folks-maint
: 670538 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-02-16 08:27 UTC by Guillaume Desmottes
Modified: 2012-03-08 00:20 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
core: Force IndividualAggregator quiescence after a 5s timeout (3.85 KB, patch)
2012-03-04 14:35 UTC, Philip Withnall
committed Details | Review
libsocialweb: Tidy up Swf.PersonaStore.prepare() to return asynchronously (11.18 KB, patch)
2012-03-04 20:29 UTC, Philip Withnall
committed Details | Review

Description Guillaume Desmottes 2012-02-16 08:27:20 UTC
Empathy now relies on the is-quiescent property to display a loading page while folks is loading contacts. But for some reason sometimes Folks never reach this state.

Sending full logs to private as it contains all my contacts.
Comment 1 Philip Withnall 2012-02-16 14:57:24 UTC
It would be useful to know exactly which PersonaStores are not reaching quiescence (because the IndividualAggregator only reaches quiescence once all its PersonaStores do).

You can find this out by running Empathy under gdb, then interrupting it a few seconds after it displays the loading screen (i.e. once you think it _should've_ reached quiescence) and calling:

print folks_debug_emit_print_status(folks_debug_dup())

in gdb.

Can you then e-mail me/Travis the output from that please?

(It would be quite nice if Empathy made it possible to view this data/call emit_print_status() from its debug window in future.)
Comment 2 Guillaume Desmottes 2012-02-21 13:38:54 UTC
*** Bug 670538 has been marked as a duplicate of this bug. ***
Comment 3 Cosimo Cecchi 2012-02-21 13:59:01 UTC
Philip: I am able to reproduce this bug...I just sent you and Travis an email containing the dump of that debug call output.
Comment 4 Philip Withnall 2012-02-24 09:29:50 UTC
Here's the problem store (from EDS):

    PersonaStore (0xaaf020)
      Ref. count:                  2
      ID:                          <censored>
      Prepared?:                   yes
      Is primary store?:           no
      Always writeable properties: gender,local-ids,postal-addresses,avatar,urls,structured-name,phone-numbers,nickname,im-addresses,is-favourite,birthday,email-addresses,roles,notes,web-service-addresses,full-name,groups
      Quiescent?:                  no
      Trust level:                 full
      Persona count:               0

It's the only store which hasn't reached quiescence, and it looks like that's because EDS hasn't returned an initial query of contacts from the address book.

Cosimo, which version of folks was this with? I made some changes to EdsfPersonaStore on 2012-01-09 which might have fixed this (d4aeea66f0719dc7a77a43372a940735cdfff4f2 and friends). They're included in 0.6.7 but not 0.6.6.

Thanks for the debug info!
Comment 5 Vincent Untz 2012-02-29 08:56:06 UTC
I have 0.6.7, fwiw. Will do the gdb magic.
Comment 6 Vincent Untz 2012-02-29 09:05:47 UTC
Relevant parts from my gdb thing:

  5 PersonaStores:
    PersonaStore (0x84f5a00)
      Ref. count:                  2
      ID:                          flickr
      Prepared?:                   yes
      Is primary store?:           no
      Always writeable properties: 
      Quiescent?:                  yes
      Trust level:                 partial
      Persona count:               0
    PersonaStore (0x84f5898)
      Ref. count:                  2
      ID:                          smugmug
      Prepared?:                   no
      Is primary store?:           no
      Always writeable properties: 
      Quiescent?:                  no
      Trust level:                 partial
      Persona count:               0
    PersonaStore (0x84f5988)
      Ref. count:                  2
      ID:                          facebook
      Prepared?:                   yes
      Is primary store?:           no
      Always writeable properties: 
      Quiescent?:                  yes
      Trust level:                 partial
      Persona count:               0
    PersonaStore (0x84f5910)
      Ref. count:                  2
      ID:                          plurk
      Prepared?:                   no
      Is primary store?:           no
      Always writeable properties: 
      Quiescent?:                  no
      Trust level:                 partial
      Persona count:               0
    PersonaStore (0x84f5820)
      Ref. count:                  2
      ID:                          twitter
      Prepared?:                   yes
      Is primary store?:           no
      Always writeable properties: 
      Quiescent?:                  yes
      Trust level:                 partial
      Persona count:               0

If I remove the libsocialweb backend, things work again.
Comment 7 Philip Withnall 2012-03-04 14:35:11 UTC
Created attachment 208954 [details] [review]
core: Force IndividualAggregator quiescence after a 5s timeout

This patch fixes the symptoms (IndividualAggregator never reaches quiescence), but not the cause of the problem (buggy EDS and libsocialweb PersonaStores). I think it's a good safety measure to add, though.

I've spotted a few problems in the libsocialweb backend which I'll take a look at later today. Hopefully that'll fix Vincent's problems.

Cosimo, could you answer my question from comment #4 please? Which version of folks did you experience this with? Is it still reproducible with 0.6.7? Thanks.
Comment 8 Philip Withnall 2012-03-04 20:29:30 UTC
Created attachment 208964 [details] [review]
libsocialweb: Tidy up Swf.PersonaStore.prepare() to return asynchronously

This tidies up the prepare() method of Swf.PersonaStore to:
 • only asynchronously return once it's actually done;
 • throw errors properly; and
 • signal the removal of the PersonaStore on an error.

This works for me, but I couldn't reproduce the original libsocialweb problems from comment #6. Vincent, would you be able to try this patch out?
Comment 9 Philip Withnall 2012-03-04 20:31:44 UTC
Patches are both available in this branch: https://www.gitorious.org/folks/folks/commits/670191-quiescence
Comment 10 Cosimo Cecchi 2012-03-04 21:57:41 UTC
(In reply to comment #7)

> Cosimo, could you answer my question from comment #4 please? Which version of
> folks did you experience this with? Is it still reproducible with 0.6.7?
> Thanks.

Hey, sorry for the delay. I wasn't using 0.6.7. I now upgraded to a newer libfolks and the bug seems to be gone for me.
Comment 11 Philip Withnall 2012-03-05 00:20:23 UTC
(In reply to comment #10)
> (In reply to comment #7)
> 
> > Cosimo, could you answer my question from comment #4 please? Which version of
> > folks did you experience this with? Is it still reproducible with 0.6.7?
> > Thanks.
> 
> Hey, sorry for the delay. I wasn't using 0.6.7. I now upgraded to a newer
> libfolks and the bug seems to be gone for me.

Great, thanks. Looks like it's just libsocialweb that's the problem now.
Comment 12 Vincent Untz 2012-03-05 07:22:07 UTC
(In reply to comment #8)
> Created an attachment (id=208964) [details] [review]
> libsocialweb: Tidy up Swf.PersonaStore.prepare() to return asynchronously
> 
> This tidies up the prepare() method of Swf.PersonaStore to:
>  • only asynchronously return once it's actually done;
>  • throw errors properly; and
>  • signal the removal of the PersonaStore on an error.
> 
> This works for me, but I couldn't reproduce the original libsocialweb problems
> from comment #6. Vincent, would you be able to try this patch out?

The patch fixes the issue for me.
Comment 13 Guillaume Desmottes 2012-03-07 08:07:22 UTC
(In reply to comment #9)
> Patches are both available in this branch:
> https://www.gitorious.org/folks/folks/commits/670191-quiescence

This branch fixes the problem for me as well (I just reproduced it with master).

Would be good to be merged/released ASAP as this bug makes Empathy unusable.
Comment 14 Philip Withnall 2012-03-08 00:20:13 UTC
Comment on attachment 208954 [details] [review]
core: Force IndividualAggregator quiescence after a 5s timeout

Committed, thanks for testing.

commit 699d009e2673bc9d078b43cdd20e5224f868bebd
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Mar 4 20:24:49 2012 +0000

    libsocialweb: Tidy up Swf.PersonaStore.prepare() to return asynchronously
    
    Previously, the prepare() method would return synchronously, firing off
    some asynchronous methods in libsocialweb, which would later return in
    callbacks and (theoretically) cause the persona store to reach quiescence.
    
    This behaviour was not playing nicely with the expected asynchronous
    behaviour of prepare(), and wasn't handling errors properly — on an error,
    the code would cancel preparation, but not throw an error or remove the
    persona store.
    
    The code now throws errors and removes the persona store if preparation
    fails, which should hopefully help some of the not-reaching-quiescence issues
    we’ve been seeing.
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=670191

 backends/libsocialweb/lib/swf-persona-store.vala |  241 +++++++++++++++-------
 1 files changed, 165 insertions(+), 76 deletions(-)

commit b7bda06afca7ad5222e26e7ef6f9765162d38093
Author: Philip Withnall <philip@tecnocode.co.uk>
Date:   Sun Mar 4 14:29:27 2012 +0000

    core: Force IndividualAggregator quiescence after a 5s timeout
    
    This prevents clients being (too) adversely affected (e.g. not being able
    to do anything) by buggy Backends and PersonaStores which never reach
    quiescence.
    
    Note that this patches the symptoms, not the cause of the problem. Good as
    a safety net, though.
    
    Helps: https://bugzilla.gnome.org/show_bug.cgi?id=670191

 NEWS                             |    1 +
 folks/individual-aggregator.vala |   51 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 52 insertions(+), 0 deletions(-)