hud-service sends insane number of dbus messages

Bug #957022 reported by desrt on 2012-03-16
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Application Menu Indicator
Fix Released
High
Charles Kerr
indicator-appmenu (Ubuntu)
High
Charles Kerr

Bug Description

An absolutely massive number of dbus messages are sent as a result of the user pressing:

  <alt> <u> <alt>

(ie: opening the hud, doing a single-letter query, closing the hud).

Some checking with dbus-monitor shows this to be about 400 messages.

This got a lot worse recently as a result of sending "opened"/"closed" messages to every single dbusmenu submenu on the entire system (active window + system indicators + appindicators) as a result of doing each search.

We have some ideas for reducing this:

a) Unity send 'CloseQuery' followed by 'StartQuery' on each keystroke of the search. hud-service immediately closes the menus on 'CloseQuery' just to re-open them again on the next 'StartQuery'. There are two ways we can fix this. First is to modify the dbus protocol to have a method to change the query string without destroying it. Second is to have a short timeout in the HUD to prevent the items from being immediately closed (in case another query comes soon).

b) dbusmenu should provide some mechanism of knowing when "opened"/"closed"/about-to-show is not necessary so we can skip it for clients that will ignore it anyway.

c) dbusmenu client should merge events -- if we send a whole batch of "opened" messages to a single client in one mainloop iteration then it should use an idle to send them out as a single messages

d) we should stop requesting dbus method call replies when we don't need them -- this may require a GLib patch

We need to track our progress. The number of dbus messages involved can be measured like so:

 - open a terminal
 - open the hud and do a search, just to make sure the terminal's menus are precached
 - dbus-monitor &> logfile
 - <alt> u <alt>
 - ^C
 - grep '^[^ ]' logfile | wc -l

the last line takes advantage of the fact that each non-indented line in the logfile represents a single message (with the indented lines giving details).

Related branches

desrt (desrt) on 2012-03-16
Changed in indicator-appmenu (Ubuntu):
importance: Undecided → High
milestone: none → ubuntu-12.04-beta-2
desrt (desrt) wrote :

Okay. '(a)' is fixed in the hud-rewrite branch. It doesn't have much impact on the single-letter case, but it has a huge impact on multi-letter searches.

Olli Ries (ories) on 2012-03-27
Changed in indicator-appmenu:
importance: Undecided → High
status: New → In Progress
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in indicator-appmenu (Ubuntu):
status: New → Confirmed
Changed in indicator-appmenu (Ubuntu):
assignee: nobody → Canonical Desktop Experience Team (canonical-dx-team)
milestone: ubuntu-12.04-beta-2 → ubuntu-12.04
tags: added: rls-mgr-p-tracking
Charles Kerr (charlesk) on 2012-04-04
Changed in indicator-appmenu:
status: In Progress → Fix Committed
David Barth (dbarth) on 2012-04-06
Changed in indicator-appmenu (Ubuntu):
status: Confirmed → Fix Committed
Changed in indicator-appmenu:
assignee: nobody → Charles Kerr (charlesk)
Changed in indicator-appmenu (Ubuntu):
assignee: Canonical Desktop Experience Team (canonical-dx-team) → Charles Kerr (charlesk)
desrt (desrt) wrote :

It's my opinion that this issue is substantially improved, but not yet fixed.

Items 'a', 'c', 'd' have all been fixed, but item 'b' is still outstanding.

Charles Kerr (charlesk) on 2012-04-12
Changed in indicator-appmenu:
status: Fix Committed → Fix Released
Changed in indicator-appmenu (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.