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

Edward Page eopage at byu.net
Sat Feb 27 10:54:59 PST 2010


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?

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?

Thanks
Ed Page
(epage)


More information about the telepathy mailing list