Ticket #2964 (assigned defect)

Opened 23 months ago

Last modified 22 months ago

Race condition while buddy initiation

Reported by: alsroot Owned by: erikos
Priority: Unspecified by Maintainer Milestone: Unspecified by Release Team
Component: sugar Version: Git as of bugdate
Severity: Unspecified Keywords:
Cc: sascha_silbe Distribution/OS:
Bug Status: Unconfirmed

Description

The problem is that right after becoming online, buddy (jabber user) is in inconsistent state before all pep ( http://xmpp.org/extensions/xep-0163.html) properties will be published on jabber server.

Attachments

Change History

Changed 23 months ago by alsroot

Attached patch is a workaround that shows the affected place in sugar shell code.

Changed 22 months ago by alsroot

Changed 22 months ago by sascha_silbe

  • owner set to erikos
  • status changed from new to assigned
  • distribution Unspecified deleted

We should probably call  SetProperties right after creating the connection in  jarabe.model.neighborhood._Account._prepare_connection(), not in  __connection_ready_cb() after the connection has been established.

Nevertheless Sugar should cope with this race condition on the receiver side. As PEP is used we should get notified of the properties as soon as the sender publishes them ( PropertiesChanged signal,  __buddy_info_updated_cb()).

If I grok the code right, this should be race-free: The signal callbacks get set up in  __get_self_handle_cb(), as part of the callback for the Status call in  __connection_ready_cb(). The  GetProperties call happens in  _update_buddy_activities() and  __get_contact_attributes_cb(), both times only in response to the signals we subscribed to in  __get_self_handle_cb():

We should consider the use case of non-Sugar buddies when fixing the receiver side of this bug: When  GetProperties fails, it can be due to this bug ( SetProperties called too late on the sender side) or because the buddy isn't running Sugar. We should be able to distinguish these two cases by examining the  capabilities (see  PEP: Filtered Notifications). In the non-Sugar case we should show the buddy right away. For Sugar buddies we might want to wait for the  PropertiesChanged signal, potentially forever.

Changed 22 months ago by sascha_silbe

  • cc sascha_silbe added
Note: See TracTickets for help on using tickets.