[Telepathy] Best way to handle the client leaking connections?

Sjoerd Simons sjoerd at luon.net
Tue Mar 9 11:12:28 PST 2010


On Sat, Feb 27, 2010 at 12:54:59PM -0600, Edward Page wrote:
> With The One Ring (GV Connection Manager) I've had a long standing bug
> about the inability to reconnect.  The issue is the user's Connection
> was never being cleaned up so another connection could never be made.
> 
> I traced various aspects of it to ways I deviate from the spec and
> leaking of some objects due to circular references.
> 
> Those helped with reconnect issues in general but not reconnect on
> connection change which the bug was filed specifically about.
> See https://bugs.maemo.org/show_bug.cgi?id=8936 and
> http://talk.maemo.org/showpost.php?p=548507&postcount=319
> Note: I've received many reports about issues on Maemo 5 and some on
> Maemo 4.1.  I don't have many Empathy users (I still need to add
> support for the latest empathy) so unsure if I ever hit it with that
> client.
> 
> One issue I found is I had the potential to go into a weird state if
> the login failed, so I force the disconnect cleanup (including
> remove_from_connection) on failed connections.
> 
> I noticed I still had an issue.  I looked closer at my logs (for
> example see log mentioned in the bug or its analysis in the above
> referenced forum post) and realized what appears to be calls to the
> Connection Manager's RequestConnection without ever getting calls to
> the Connection's Connect.  My guess is between the client calling
> RequestConnection and Connect, the client is informed of network loss
> and cleans up all active channels, losing the one it is trying to
> Connect.  Does this sound accurate?

That's odd, at least in maemo 5 MC5 should keep track of all the connections
and make sure that they're not left hanging aournd.

> This would create a Connection and attach it to DBus but never cause a
> remove_from_connection, preventing another Connection to be created.
> This put The One Ring into a sort-of no man's land.  The client didn't
> acknowledge it left the connection around so each time it would try to
> call RequestConnection again it would fail.  The One Ring never knew
> that it needed to cleanup that connection and would blissfully think
> all is well.
> 
> To work around this issue I added a 10 second timeout to the
> Connection's constructor.  If Connect isn't called before then, then
> the Connection is cleaned up.
> 
> I was wondering:
> * Was a timeout the best solution or is there some cleanup in the
> other CM's I missed that is suppose to handle that case
> * Would this be considered a bug in the client that I should go and report?

This seems to be an issue in the client. Which client are you using? Definately
this shouldn't happen if mission control is used.

  Sjoerd
-- 
IN MY OPINION anyone interested in improving himself should not rule out
becoming pure energy.
		-- Jack Handey, The New Mexican, 1988.


More information about the telepathy mailing list