Bug 9434

Summary: gabble don't release dbus name
Product: Telepathy Reporter: Xavier Claessens <xclaesse>
Component: gabbleAssignee: Robert McQueen <robert>
Status: RESOLVED FIXED QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: normal    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: proposed patch

Description Xavier Claessens 2006-12-23 15:17:32 UTC
Using gossip, when I disconnect and reconnect a gabble account too fast I get
this error message:

** (gossip:32393): WARNING **: Connect() failed: Error acquiring bus name
org.freedesktop.Telepathy.Connection.gabble.jabber._testman_jabber_belnet_be_Telepathy:
Connection manager already has a connection to this account.

If I wait some seconds before reconnecting it works because gabble timeout and
exits. If I run gabble with persist it never release the name.

When reconnecting gossip tries to get existing connections, but the old
connection has the disconnected status so it doesn't use it and prefer to
request a new connection.

Here is gabble's debug messages:

** (telepathy-gabble:414): DEBUG: request_reply_cb: Request 0x80d0d10 succeeded,
notifying callback 0x80572e0
** (telepathy-gabble:414): DEBUG: delete_request: Discarding request 0x80d0d10
** (telepathy-gabble:414): DEBUG: connection_status_change: status 2 reason 1
** (telepathy-gabble:414): DEBUG: gabble_roster_factory_iface_close_all: closing
channels
** (telepathy-gabble:414): DEBUG: gabble_muc_factory_iface_close_all: closing
channels
** (telepathy-gabble:414): DEBUG: gabble_media_factory_iface_close_all: closing
channels
** (telepathy-gabble:414): DEBUG: connection_status_change: emitting
status-changed with status 2 reason 1
** (telepathy-gabble:414): DEBUG: gabble_roster_factory_iface_disconnected:
removing callbacks
** (telepathy-gabble:414): DEBUG: gabble_muc_factory_iface_disconnected:
removing callbacks
** (telepathy-gabble:414): DEBUG: gabble_media_factory_iface_disconnected:
removing callbacks
** (telepathy-gabble:414): DEBUG: connection_status_change: still open; calling
lm_connection_close
** (telepathy-gabble:414): DEBUG: connection_disconnected_cb: called with reason 0
** (telepathy-gabble:414): DEBUG: connection_disconnected_cb: expected; emitting
DISCONNECTED
** (telepathy-gabble:414): DEBUG: connection_disconnected_cb: dereferenced
connection
** (telepathy-gabble:414): DEBUG: gabble_connection_get_protocol: rejected
request as disconnected
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value
testman@jabber.belnet.be for param account
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value <hidden> for
param password
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value
jabber.belnet.be for param server
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value Telepathy for
param resource
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 0 for param
priority
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 5223 for
param port
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 1 for param
old-ssl
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 0 for param
register
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 0 for param
low-bandwidth
** (telepathy-gabble:414): DEBUG: parse_parameters: using default value for
param https-proxy-server
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 443 for param
https-proxy-port
** (telepathy-gabble:414): DEBUG: parse_parameters: using default value for
param fallback-conference-server
** (telepathy-gabble:414): DEBUG: parse_parameters: using default value for
param stun-server
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 3478 for
param stun-port
** (telepathy-gabble:414): DEBUG: parse_parameters: accepted value 1 for param
ignore-ssl-errors
** (telepathy-gabble:414): DEBUG: parse_parameters: using default value for
param alias
gabble_properties_mixin_emit_changed: emitting properties changed for property:
  stun-port
gabble_properties_mixin_emit_flags: emitting properties flags changed for property:
  stun-port's flags now: [READ]
** (telepathy-gabble:414): DEBUG: gabble_connection_manager_request_connection
failed: Error acquiring bus name
org.freedesktop.Telepathy.Connection.gabble.jabber._testman_jabber_belnet_be_Telepathy:
Connection manager already has a connection to this account.
** (telepathy-gabble:414): DEBUG: gabble_connection_dispose: called
** (telepathy-gabble:414): DEBUG: gabble_roster_dispose: dispose called
** (telepathy-gabble:414): DEBUG: gabble_roster_factory_iface_close_all: closing
channels
** (telepathy-gabble:414): DEBUG: gabble_roster_finalize: called with 0x80aee90
** (telepathy-gabble:414): DEBUG: gabble_muc_factory_dispose: dispose called
** (telepathy-gabble:414): DEBUG: gabble_muc_factory_iface_close_all: closing
channels
** (telepathy-gabble:414): DEBUG: gabble_media_factory_dispose: dispose called
** (telepathy-gabble:414): DEBUG: gabble_media_factory_iface_close_all: closing
channels
** (telepathy-gabble:414): DEBUG: gabble_disco_dispose: dispose called
** (telepathy-gabble:414): DEBUG: gabble_disco_finalize: called with 0x80b3500
** (telepathy-gabble:414): DEBUG: gabble_presence_cache_dispose: dispose called
** (telepathy-gabble:414): DEBUG: gabble_presence_cache_finalize: called with
0x80d8a40
** (telepathy-gabble:414): DEBUG: gabble_connection_finalize: called with 0x80b08b8
Comment 1 Xavier Claessens 2006-12-24 06:31:29 UTC
Seems butterfly has the same problem, the name stay with disconnected status.
Comment 2 Xavier Claessens 2007-01-10 04:20:17 UTC
I looked a bit more into the problem. When I disconnect a connection, the
GabbleConnection object has refcount=7, changing status to disconnected remove
one ref, if I add 5 g_object_unref (a ref is kept by glib/dbus for the method
call) the object is destroyed, the name released and gossip can reconnect the
account directly with no problem.
Comment 3 Xavier Claessens 2007-01-11 04:58:08 UTC
Created attachment 8364 [details] [review]
proposed patch

g_object_get() returns a new ref, so we need to unref the conn before
returning.
Comment 4 Simon McVittie 2007-01-30 07:35:59 UTC
Patch merged in 0.5.1, thanks. We believe this should now be fixed.

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.