zeitgeist does not close properly

Bug #809569 reported by Seif Lotfy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zeitgeist Framework
Fix Released
High
Siegfried Gevatter

Bug Description

Trying to replace a current running zeitgeist with "zeitgeist-daemon --replace" ends up with

[DEBUG - root] Running datahub (/usr/bin/zeitgeist-datahub) with PID=23521
[INFO - root] Starting Zeitgeist service...
[ERROR - dbus.proxies] Introspect error on :1.239:/org/gnome/zeitgeist/log/activity: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[DEBUG - dbus.proxies] Executing introspect queue due to error
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/dbus/connection.py", line 586, in msg_reply_handler
    reply_handler(*message.get_args_list(**get_args_opts))
  File "/home/seif/Projects/zeitgeist/zeitgeist/client.py", line 176, in name_owner_changed
    self.reconnect()
  File "/home/seif/Projects/zeitgeist/zeitgeist/client.py", line 73, in reconnect
    self._load_introspection_data()
  File "/home/seif/Projects/zeitgeist/zeitgeist/client.py", line 157, in _load_introspection_data
    self.__proxy.Introspect())
  File "/usr/lib/pymodules/python2.7/dbus/proxies.py", line 68, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/pymodules/python2.7/dbus/proxies.py", line 143, in __call__
    **keywords)
  File "/usr/lib/pymodules/python2.7/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[ERROR - dbus.proxies] Introspect error on :1.239:/org/gnome/zeitgeist/log/activity: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
[DEBUG - dbus.proxies] Executing introspect queue due to error

----
I also attached a video that shows the bug in action

Related branches

Revision history for this message
Seif Lotfy (seif) wrote :
Revision history for this message
Siegfried Gevatter (rainct) wrote :

Indeed. This only happens when you replace an existing Zeitgeist instance.

When that happens, a ZeitgeistDBusInterface instance is created to call Quit on the already running Zeitgeist daemon. The ZeitgeistDBusInterface object is deleted as soon as it goes out of scope, but the _DBusInterface object it uses internally remains alive (since it is referenced from the __shared_state class variable). This means that as soon as the new daemon claims the D-Bus name, the _DBusInterface's reconnection routine is called and it gets stuck there until the Introspect() call it starts times out (be it because the daemon can't answer to itself -since while in the call the mainloop isn't running- or because the D-Bus service hasn't been set up completely yet, not sure which of the two, but it doesn't really matter).

I've milestoned this for 0.8.2.1, which we should release as soon as this bug is fixed (together with the properties fix).

I've pushed a branch to lp:~zeitgeist/zeitgeist/no-reconnect that adds an option to _DBusInterface and ZeitgeistDBusInterface to not reconnect automatically (I think this part is useful anyway). It then uses this to avoid the above described behavior.

It'd also be nice to make sure the _DBusInterface instance gets garbage collected when it isn't needed anymore.

Changed in zeitgeist:
importance: Undecided → High
milestone: none → 0.8.2.1
status: New → Triaged
Seif Lotfy (seif)
Changed in zeitgeist:
assignee: nobody → Siegfried Gevatter (rainct)
status: Triaged → Fix Committed
Changed in zeitgeist:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.