The code to ping an url is blocking
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu Single Sign On Client | Status tracked in Trunk | |||||
Stable-3-0 |
Fix Released
|
Undecided
|
Unassigned | |||
Trunk |
Fix Released
|
Medium
|
Alejandro J. Cura |
Bug Description
(from https:/
59 + # This code is blocking, we should change this.
60 + # I've tried with deferToThread an twisted.
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-
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
- Manuel de la Peña (community): Approve
- Natalia Bidart (community): Approve
-
Diff: 910 lines (+250/-187)12 files modifiedrun-tests (+8/-4)
ubuntu_sso/account.py (+36/-16)
ubuntu_sso/credentials.py (+9/-12)
ubuntu_sso/tests/test_account.py (+22/-1)
ubuntu_sso/tests/test_credentials.py (+59/-53)
ubuntu_sso/utils/webclient/common.py (+1/-1)
ubuntu_sso/utils/webclient/restful.py (+4/-0)
ubuntu_sso/utils/webclient/tests/__init__.py (+60/-0)
ubuntu_sso/utils/webclient/tests/test_restful.py (+12/-0)
ubuntu_sso/utils/webclient/tests/test_timestamp.py (+16/-32)
ubuntu_sso/utils/webclient/tests/test_webclient.py (+14/-63)
ubuntu_sso/utils/webclient/timestamp.py (+9/-5)
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 |