Skip to content
Snippets Groups Projects
Commit abde3e0e authored by Olivier Dony's avatar Olivier Dony
Browse files

[IMP] http: LazyResponse rendering w/ concurrent access protection

QWeb's LazyResponse mechanism allows controllers to be inherited
and to alter the rendering context (qwebcontext) *after* calling
super().

However it caused the final rendering to occur outside the protection
of the @service.model.check decorator that handles concurrent access
errors. In rare cases the lazy rendering can be interrupted by
a concurrent access error, for example when bootstrapping the
the cache of asset bundles (as it INSERTs a bunch of attachments).

By forcing the flatten()ing of the lazy response earlier, right
after calling the route's endpoint(), it occurs within the
protection of the @service.model.check, and benefits from the
automatic retry.

flatten() was modified to avoid rendering twice the template
The flatten() in get_response() is still necessary for addons
code that directly calls get_response().

Moved QWebException into openerp.exceptions next to the other
exceptions classes - since it now has more global semantics.

~
The whole request dispatching code could really do with a
complete redesign/simplification.
parent b9420fde
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment