The code to ping an url is blocking

Bug #697628 reported by Natalia Bidart on 2011-01-05
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Single Sign On Client
Status tracked in Trunk
Stable-3-0
Undecided
Unassigned
Trunk
Medium
Alejandro J. Cura

Bug Description

(from https://code.launchpad.net/~nataliabidart/ubuntu-sso-client/no-more-gobject/+merge/44988 )

59 + # This code is blocking, we should change this.
60 + # I've tried with deferToThread an twisted.web.client.getPage
61 + # but the returned deferred will never be fired (nataliabidart).

Neither deferToThread nor getPage will work because the twisted reactor is not used anymore in ubuntu-sso-client. Only twisted Deferreds are used in this code, but only as a control structure in order to make the sequence of callbacks cleaner, and to ease testing with trial.

I'm thinking of a few ways to have safe async http calls here: using libsoup or putting back the twisted reactor.

Using libsoup (like the ubuntuone-control-panel backend uses) would make the code dependent once again on gobject and possibly gnome, but it will make supporting all kind of proxies a one liner.

Using twisted will make the code more portable, but the backend should be moved to its own process (also just like u1cp) to avoid the problems we had when we mixed gtkwebkit and the twisted reactor.

Yet another option would be to move the ping url code to the gui layer, where each toolkit would choose the best async way to do it. (a Gnome ui would use libsoup, etc).

Related branches

Changed in ubuntu-sso-client:
status: New → Triaged
importance: Undecided → Medium
Changed in ubuntu-sso-client:
assignee: nobody → Alejandro J. Cura (alecu)
Changed in ubuntu-sso-client:
status: Triaged → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers