I've been checking with @ivantodorovich an #Odoo issue where we randomly had on some instances an exception saying "AttributeError: 'Request' object has no attribute 'session'" on #Odoo16. In that case the worker is lost and we need to kill it.

I suspect that the docker image we are using were using a theoreticaly supported Werkzeug version of 0.16.1, on Python 3.9 (as per Odoo's requirements.txt).
We upgraded to Python 3.10 and Werkzeug 2.0.3 and hopefully this will solve the issue.

This was also the occasion to read this super interesting #Odoo commit message, which gives some insights about the updates to the HTTP stack in #Odoo16

https://github.com/odoo/odoo/pull/78857

[REF] core: httpocalypse by Julien00859 · Pull Request #78857 · odoo/odoo

This work is a comprehensive refactor of our HTTP framework. Branches and PRs https://github.com/odoo-dev/odoo/tree/master-httpocalypse-juc #78857 odoo/enterprise#21849 odoo/design-themes#524 Dis...

GitHub

Actually this error is unrelated to #Werkzeug. The fix was committed in #Odoo yesterday in

https://github.com/odoo/odoo/pull/166524

[FIX] http: ensure _request_stack.pop() is always called after _request_stack.push(...) by Jenjen1324 · Pull Request #166524 · odoo/odoo

Impacted versions: 17.0 16.0 Description of the issue/feature this PR addresses: The addition of request._post_init() in #104573, introduced the possibility that _request_stack.pop() is not calle...

GitHub