Get proxy object for existing process - Filter by command line

Bug #1285575 reported by Javier Collado
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Autopilot
In Progress
Low
Unassigned

Bug Description

When trying to create a proxy object based on an application name as follows:
get_proxy_object_for_existing_process(application_name='gallery-app')

I get a few error messages like this:
ERROR:dbus.proxies:Introspect error on :1.31:/com/canonical/Autopilot/Introspection: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: No such object path '/com/canonical/Autopilot/Introspection'

and the call takes quite a while to complete. The reason, as discussed through e-mail, seems to be that autopilot queries through dbus a lot of connections and has to wait for some of them to time out.

On the other hand, something like looking for the process using psutil works much faster because there's no need to query so many connections:

    gallery_process = next(p for p in psutil.get_process_list() if p.name == 'gallery-app')
    return get_proxy_object_for_existing_process(pid=gallery_process.pid)

Hence, it would be nice to implement something like this in get_proxy_object_for_existing_process (maybe filtering by command line instead of just by application name) to speed up the proxy object retrieval.

Related branches

Changed in autopilot:
assignee: nobody → Javier Collado (javier.collado)
Changed in autopilot:
status: New → Confirmed
importance: Undecided → Low
status: Confirmed → In Progress
Changed in autopilot:
assignee: Javier Collado (javier.collado) → nobody
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.