zeitgeist does not close properly
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/
[INFO - root] Starting Zeitgeist service...
[ERROR - dbus.proxies] Introspect error on :1.239:
[DEBUG - dbus.proxies] Executing introspect queue due to error
Traceback (most recent call last):
File "/usr/lib/
reply_
File "/home/
self.
File "/home/
self.
File "/home/
self.
File "/usr/lib/
return self._proxy_
File "/usr/lib/
**keywords)
File "/usr/lib/
message, timeout)
dbus.exceptions
[ERROR - dbus.proxies] Introspect error on :1.239:
[DEBUG - dbus.proxies] Executing introspect queue due to error
----
I also attached a video that shows the bug in action
Related branches
- Seif Lotfy: Approve
-
Diff: 66 lines (+9/-4)2 files modified_zeitgeist/singleton.py (+1/-1)
zeitgeist/client.py (+8/-3)
Changed in zeitgeist: | |
assignee: | nobody → Siegfried Gevatter (rainct) |
status: | Triaged → Fix Committed |
Changed in zeitgeist: | |
status: | Fix Committed → Fix Released |
Indeed. This only happens when you replace an existing Zeitgeist instance.
When that happens, a ZeitgeistDBusIn terface instance is created to call Quit on the already running Zeitgeist daemon. The ZeitgeistDBusIn terface 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 ZeitgeistDBusIn terface 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.