Librarian client should timeout faster

Bug #765 reported by Stuart Bishop
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Triaged
Low
Unassigned

Bug Description

The Librarian client currently hangs indefinitly if there is no response from the Librarian.

Instead, and exception should be raised if there is no response from the Librarian for one second (which is more than enough time if the Librarian is functioning correctly).

Dafydd Harries (daf)
Changed in launchpad:
status: New → Accepted
Revision history for this message
Christian Reis (kiko) wrote :

Actually, if you look at bug 140818, you'll notice that 1 second is actually not enough. Part of the problem may be bug 140817, but part of it is that the database just can't be counted on to respond in less than one second.

Revision history for this message
Christian Reis (kiko) wrote :

Assigning to Francis, but I'm curious: what's the default timeout set to?

Changed in launchpad:
assignee: nobody → flacoste
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

There is no default timeout (None), which means to wait indefinately.

description: updated
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

This could be fixed easily now by using canonical.lazr.timeout.urlfetch to retrieve files. We can use the with_timeout decorator for the other requests that aren't using urlopen() to talk to the librarian.

Changed in launchpad-foundations:
assignee: flacoste → nobody
status: Confirmed → Triaged
Curtis Hovey (sinzui)
visibility: private → public
Revision history for this message
Robert Collins (lifeless) wrote :

https://lp-oops.canonical.com/oops.py/?oopsid=OOPS-1665EA1853

I think 1 second is tonnes of time: if the DB can't answer a simple lookup as this in 1 second, given our scaled out infrastructure, we are going to find delivering high responsiveness terribly hard.

https://bugs.edge.launchpad.net/launchpad-foundations/+bug/140817 may be stale, and even if it isn't, we don't want server threads hanging about for 20 minutes when using the librarian.

There are two parts to this I think:
 - extend the client code to accept a per-connection timeout value (rather than changing a global)
 - pass down to the client the *remaining appserver timeout allowance* automatically. That way, a fresh request has the maximum possible timeout, and one at the end of a slow transaction has a shorter timeout.

Revision history for this message
Robert Collins (lifeless) wrote :

Also shows up as
 SoftRequestTimeout: <security proxied canonical.launchpad.browser.librarian.StreamOrRedirectLibraryFileAliasView instance at 0xcb0ef90>

    Traceback (most recent call last):
SoftRequestTimeout: <security proxied canonical.launchpad.browser.librarian.StreamOrRedirectLibraryFileAliasView instance at 0xcb0ef90>

Changed in launchpad-foundations:
milestone: none → 10.08
importance: Medium → High
Revision history for this message
Robert Collins (lifeless) wrote :

importance/milestone carried over from the duplicate.

Revision history for this message
Robert Collins (lifeless) wrote :

StreamOrRedirect view is no longer needed; MP diffs are size capped so shouldn't trigger this - can reevaluate priority if we find this is implicated in oopses going forward.

Changed in launchpad-foundations:
importance: High → Medium
Changed in launchpad:
importance: Medium → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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