[packagekit] outdated tooltips

Richard Hughes hughsient at gmail.com
Wed Nov 14 09:17:41 PST 2007

On Tue, 2007-11-13 at 23:21 -0500, Matthias Clasen wrote:
>When does pk-update-icon update its tooltip ?

At startup, or when an UpdatesChanged signal is received from the

>I had it tell me that there are 45 updates.
>Then I ran yum update on the cmdline (since I expected to have to
>manually exclude things).
>The pk-update-icon statusicon did not change, and still told me that
>there are 45 updates.

Right, PackageKit doesn't poll yum for updates, so if you did it without
using PackageKit and installed the updates then packagekitd has no way
to know the updates state has changed.

>Then I opened pk-update-viewer, which found 3 new updates.

Right, this calls a GetUpdates method, which for yum gets the new data,
assuming it's not already cached. If it's not already cached then the
backend method is called, and UpdatesChanged is emitted if the update
list is different.

>And the statusicon tooltip still told there are 45.

Well, PackageKit holds a cache of the update list when it is loaded in
memory (default loaded when idle is for 60 seconds) so that if a user
checks for updates, and the update list changes then there may be quite
a few clients asking for the new update list. On a single user box,
there might only be one or two GetUpdates calls, but on a multiuser box
with 10 logged in users there might be up to 20 calls. Hence we cache
this data rather than spawn the backend multiple times. Doing GetUpdates
on some backends (conary) is expensive, and would take a long time for
backends like portage.

I think what's happening here is either:

1. a bug where UpdatesChanged is not forcing the tooltip to refresh.
Looking at the code suggests this isn't the case.
2. an instance of the update icon asking the daemon for data while the
daemon is active (and hence getting the cached list) and then the daemon
exiting before you run pk-update-viewer. When pk-update-viewer is
started it executes GetUpdates which reactivates the daemon, and gets a
non-cached list from the backend.

If the daemon caching is indeed the problem then we need a way from yum
on the command line to tell PackageKit that it's done something. This
would need a patch to yum, so might be difficult to do. Maybe the yum
cli.py could call into PackageKit via DBUS (BackendStateMayHaveChanged)
when any transaction on the command line has completed. This would allow
the daemon to drop it's cache and not supply invalid data.



More information about the PackageKit mailing list