qtmir should probably use more of ual apis

Bug #1685815 reported by Dimitri John Ledkov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
qtmir (Ubuntu)
New
Wishlist
Unassigned

Bug Description

qtmir currently has some cgmanager code.

However, since then ual has evolved and switched to systemd, and provides better apis then quering cgmanager.
Plus quering cgmanager is pointless, since systemd doesn't use the same cgroups paths.

<xnox> alan_g, Saviq - so ubuntu-app-launch has moved onto systemd, yet qtmir is using cgmanager/upstart cgroup paths to determine related app pids
<xnox> so my understanding is that fetchAssociatedPids is now broken.
<xnox> and effectively always returns "which is not app-specific"
<xnox> (e.g. does not find any related pids)
<Saviq> that might very well be, greyback ↑ ?
<alan_g> greyback: ^^
<xnox> QSet<pid_t> DBusFocusInfo::fetchAssociatedPids(pid_t pid) always goes down the else path, as no things in zesty+ have 'upstart' in their cgroup
<greyback> xnox: I think you're right yes. However that code is only used to expose a pid list via dbus of focused apps, which is used only by autopilot I think.
* mhall119 (~mhall@ubuntu/member/mhall119) has joined
<xnox> aha
<greyback> it is not important code, and we didn't notice this bug in the systemd transition
<greyback> because almost nobody uses that dbus api
<xnox> greyback, i think i will make the code to go down the else path, without changing any api/abi
<xnox> and drop build-dep and runtime dep on the cgmanager.
<xnox> meaning i'm not making things any worse.
<xnox> it is possible that autopilot uses ubuntu-app-launch apis directly for the systemd code path =/
<greyback> xnox: I think that change won't hurt anyone that we care about
* AlbertA (~<email address hidden>) has joined
* AlbertA_ (~<email address hidden>) has joined
* AlbertA_ has quit (Remote host closed the connection)
* shiznix has quit (Ping timeout: 240 seconds)
* AlbertA has quit (Client Quit)
* AlbertA (~<email address hidden>) has joined
* ChrisTownsend has quit (Ping timeout: 260 seconds)
* mhall119 has quit (Remote host closed the connection)
<xnox> running tests now, fingers crossed
<xnox> horay!
<xnox> onto gles variant
* ChrisTownsend (~townsend@96-67-93-93-static.hfc.comcastbusiness.net) has joined
* JanC_ (~janc@lugwv/member/JanC) has joined
* JanC has quit (Killed (barjavel.freenode.net (Nickname regained by services)))
* JanC_ is now known as JanC
* Son_Goku has quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
<xnox> greyback, i've asked tedg if there is anyway to get all the pids from ubuntu-app-launch and here is his response
<xnox> <tedg> xnox: Yup, you can grab it from the instance object, pids() returns a vector.
<xnox> <tedg> xnox: You can also call ubuntu-app-launch-pids
<xnox> <xnox> nice.
<xnox> <tedg> xnox: But those will only really work on U8...
<xnox> so either autopilot should use that, or qtmir should re-expose that over db
<greyback> xnox: right. UAL does make that possible, we just kept neglecting that particular bit of code
<xnox> ah, ok.
<xnox> i shall open a bug report.
<xnox> at least

<tedg> xnox: Yup, you can grab it from the instance object, pids() returns a vector.
<tedg> xnox: You can also call ubuntu-app-launch-pids
<xnox> nice.
<tedg> xnox: But those will only really work on U8...
<xnox> tedg, qtmir exposes something similar via dbus, by iterating things with cgmanager DBusFocusInfo::fetchAssociatedPids(pid_t pid)
<xnox> tedg, do you happen to know if autopilot switched from qtmir dbus api, to the ubuntu-app-launch pids() api?
<tedg> xnox: I'm not sure, but I think qtmir uses ual as its backend there.
<tedg> xnox: So it should be *much* faster under systemd than Upstart.
<xnox> tedg, nope, it links cgmanager, gets cgmanager dbus proxy object, looks up cgroup path to contain /upstart/ and checks the freezer group for tasks.
<xnox> at least for that call, which is exposed via dbus, which supposedly only autopilot uses
<xnox> maybe it uses ual api somewhere else, but i didn't look.
<xnox> tedg, thank you very much for your responses!
<xnox> tedg, from #ubuntu-mir channel <greyback> xnox: right. UAL does make that possible, we just kept neglecting that particular bit of cod
<xnox> i shall open a bug report.
<greyback> yep, it is an old bit of code, new UAL can probably help it out

Changed in qtmir (Ubuntu):
importance: Undecided → Wishlist
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.