Bug 481551 - Flatpak applications are doubled in the System Monitor
Summary: Flatpak applications are doubled in the System Monitor
Status: RESOLVED FIXED
Alias: None
Product: plasma-systemmonitor
Classification: Applications
Component: general (show other bugs)
Version: 6.1.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KSysGuard Developers
URL:
Keywords: qt6
Depends on:
Blocks:
 
Reported: 2024-02-19 16:53 UTC by Artem
Modified: 2024-10-26 00:40 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In: 6.3.0
Sentry Crash Report:


Attachments
Applications list in the System Monitor (73.90 KB, image/png)
2024-02-19 16:54 UTC, Artem
Details
Output of systemd-cgls.log (24.73 KB, text/x-log)
2024-08-21 15:01 UTC, Nate Graham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Artem 2024-02-19 16:53:10 UTC
SUMMARY
I added to the autostart several applications installed as Flatpak. After running the system, some of these applications (if specifically, KeePassXC) do not get into the tray, and in System Monitor these applications are displayed twice (half of them without the used memory). If I restart these applications, in System Monitor they will be displayed correctly, only once. 
Bug 462735 (and all mentioned in 473860) partially looks like my situation, but it doesn't mention duplication in the System Monitor, so I decided to create a new ticket. 

STEPS TO REPRODUCE
1. Add some Flatpak applications to autostart in the KDE Settings
2. Restart the system
3. Open System Monitor

OBSERVED RESULT
Flatpak applications are duplicated on the Applications tab

EXPECTED RESULT
All applications listed only once

SOFTWARE/OS VERSIONS
Qt Version: 6.6.1
Frameworks Version: 5.249.0
Operating System: Linux 6.8.0-0.rc4.20240212git716f4aaa7b48.35.fc40.x86_64 x86_64
Windowing System: Wayland
Distribution: Fedora Linux 40.20240213.n.1 (Kinoite Prerelease)
Comment 1 Artem 2024-02-19 16:54:01 UTC
Created attachment 165940 [details]
Applications list in the System Monitor
Comment 2 Artem 2024-08-18 11:35:14 UTC
The problem is still being observed. But I realized that this has nothing to do with autostart - all flatpak applications running at any moment are duplicated.

Operating System: Fedora Linux 40
KDE Plasma Version: 6.1.4
KDE Frameworks Version: 6.5.0
Qt Version: 6.7.2
Kernel Version: 6.10.4-200.fc40.x86_64 (64-bit)
Graphics Platform: Wayland
Comment 3 Nate Graham 2024-08-20 21:16:38 UTC
I can reproduce that too.
Comment 4 Arjen Hiemstra 2024-08-21 08:59:27 UTC
Yeah I'm seeing this too. The problem however is that Flatpak seems to create two cgroups for one application, which breaks our original assumption that one cgroup is one application. I don't know exactly why this happens, I seem to recall looking into this and ending up at some Electron thing.

But maybe you can share the output of `systemd-cgls` when this happens to confirm it's the same thing?
Comment 5 Nate Graham 2024-08-21 15:01:46 UTC
Created attachment 172817 [details]
Output of systemd-cgls.log

Attached. I actually have *three* instances of Discord showing up in my Applications page right now.
Comment 6 Bug Janitor Service 2024-10-10 12:25:19 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/libksysguard/-/merge_requests/373
Comment 7 Arjen Hiemstra 2024-10-24 10:04:37 UTC
Git commit 96cd4ed58e984fc1f2125c63b0e93dea8c427c48 by Arjen Hiemstra.
Committed on 24/10/2024 at 10:02.
Pushed by ahiemstra into branch 'master'.

processcore: Make ApplicationDataModel aggregate similar CGroups into one entry

This changes ApplicationDataModel to aggregate similar CGroups into one
application entry.

The primary motivation for this is that a single Flatpak application
instance may spawn several separate CGroups that we would list as
separate applications before this change, but which logically belong to
the same application. Upstream has indicated this behaviour is
intentional and seems to have no inclination on adding anything to allow
us to identify these cases, so we are left with just merging everything.

This is also slightly more aggressive in filtering out some things that
are currently listed but aren't really applications, most notably some
D-Bus autostarted applications.

M  +99   -5    processcore/application_data_model.cpp
M  +23   -0    processcore/application_data_model.h

https://invent.kde.org/plasma/libksysguard/-/commit/96cd4ed58e984fc1f2125c63b0e93dea8c427c48