[FIX] avoid systematically deadlocking the stand-alone OpenERP web in its default...
authorXavier Morel <xmo@openerp.com>
Mon, 19 Dec 2011 14:57:59 +0000 (15:57 +0100)
committerXavier Morel <xmo@openerp.com>
Mon, 19 Dec 2011 14:57:59 +0000 (15:57 +0100)
commit75409e349a0ca4488e477b9621991145e6890d5c
treea59abad97fc856f761e50cfd5b39b82cacffe111
parent248654d97e88a9e45506791a738be1ae3e801df3
[FIX] avoid systematically deadlocking the stand-alone OpenERP web in its default configuration

The default configuration for OpenERP Web standalone (launched via the
openerp-web script) is single-threaded for log-readability purposes.

web.common.controllers.main.Proxy.load has been added to wrap a
request to an HTTP handler inside a JSON (and/or JSONP) request, the
initial implementation was to perform a full HTTP call *from within an
HTTP handler to itself*.

Since the server is single-threaded and its only thread is already
busy, it can't handle the new request, and the client deadlocks.

Replaced this crap by also-crap-but-slightly-less-so: instantiating a
Werkzeug test client using the root application and proxying the
request through that. Avoids creating a new request from the server,
therefore does not deadlock.

lp bug: https://launchpad.net/bugs/905384 fixed

bzr revid: xmo@openerp.com-20111219145759-m10zgo3tcd6zjhcu
addons/web/common/http.py
addons/web/controllers/main.py