Delay in the 'Log out' dialog, likely PackageKit-related (activated via DBus)

Symptoms:

If we want to log off or shut down, it takes a while (~5 seconds) before the 'Log out' dialog is shown. I've only started noticing this since upgrading to Fedora 44. I was used to it showing instantly.

Steps to reproduce:

  1. Log on to Xfce Desktop.
  2. Run 'systemctl status packagekit' and observe its state (in my case it was not running).
  3. Press 'Log out'.
  4. Notice it takes a few seconds before the 'Log out' dialog is shown.
  5. Run 'systemctl status packagekit' again and observe that it's running. The journal/log doesn't reveal much, other than that the PackageKit daemon started.

Probable cause:

It seems related to PackageKit being started when we log off, because Xfce queries PackageKit via dbus. Though, the slow down might be most noticeable if we haven't run the system for a few days. So it might be that the slow down is because perhaps PackageKit performs certain actions (like updating an internal database) if it hasn't been run in a few days.

In an older Fedora 41 VM, I don't see this issue. Similar to Fedora 44, the PackageKit service is not active by default (it only starts when triggered). And when we let Xfce show the 'Log out' dialog and then check 'systemctl status packagekit', we see that PackageKit is still 'inactive (dead)'. Contrary to Fedora 44, where we see that PackageKit went from 'inactive (dead)' to 'active (running)'.

Possible workarounds/solutions:

  • Currently, xfce4-session/xfsm-logout-dialog.c checks if PackageKit has prepared updates. But maybe it should only check this if PackageKit is actually running? Though that might run into the problem of never showing the 'Update and Shut Down' action if PackageKit stops running when it's idle (though I don't know whether it does that).

  • Or, maybe this issue should be reported upstream, such that perhaps PackageKit will only perform the slower operations if PackageKit has already been running for a few minutes. This seems like an elegant fix.

  • A user can remove PackageKit from their system if nothing else depends on it. I tested this and it helps (the log out dialog is fast again). But it's quite a drastic measure.

  • A user can mask the packagekit.service systemd unit. This also works. But again, it's quite a drastic measure.

Relevant info:

In the xfce4-session/NEWS change log, we see this in the 4.19.1 (2023-05-29) section:

$ grep -i packagekit ./NEWS
- cleanup: Move packagekit code from xfsm-systemd.c to xfsm-shutdown.c
- packagekit: Don't warn if packagekit is not installed

Just a note. I haven't investigated whether that's involved.

Versions:

  • Fedora 44
  • Xorg 21.1.24
  • xfce4-session 4.20.3

(This report was written by hand.)

Edited by Jelle Geerts