Bug 23703

Summary: Race between tube SI and capabilities
Product: Telepathy Reporter: Alban Crequy <alban.crequy>
Component: gabbleAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED MOVED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Alban Crequy 2009-09-04 04:24:46 UTC
I think George's problems on Gabble tubes are this race: scenario: contact1 offers a tube to contact2:
      - contact2 connects
      - contact2 ask contact1's caps
      - contact1 receives contact2's presence
      - contact1 offer a tube to contact2
      - contact2 accept the tube
      - local application on contact2 computer connects on the tube
      - contact2 still didn't received caps from contact1
      - contact2 is looking for the right resource on contact1 to send bytestream initiation, which is the resource which has the tube capabilities (maybe it should just be the resource which offered the tube)
      - contact2 is confused: no tube capabilities on contact1's resources
      - contact2 closes the tube
      - contact2 receives contact1's caps, eventually

This is in src/tube-stream.c start_stream_initiation() line 514.

Possible solution:
1. either delay accepting the tube when we don't have the caps from the offerer (weird solution to me)
2. or remember the resource which offered the tube and send SI to that resource

The second solution looks better to me because even if the caps are received instantly everywhere, I think the tube code is wrong: we should not send the SI to *any* resource which has the right caps but to the resource which offer the tube. If contact1 has several gabble running on different computers with different resources (all with the tube caps), it will randomly work/don't work with the current implementation, depending which resource it chooses.
Comment 1 Alban Crequy 2009-09-04 04:26:11 UTC
Daf suggests that the scenario with different resources can be added in the unit tests.
Comment 2 GitLab Migration User 2019-12-03 19:20:34 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-gabble/issues/50.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.