Commit 07ecaeb3 authored by Nicolas Dumazet's avatar Nicolas Dumazet

Because we cache so much attribute lookups in local variables,

it is evil to recreate the attributes during _aq_reset.

Scenario:
 * First call to aq_dynamic
 * aq_portal_type = Base.aq_portal_type
    - inner aq_dynamic business
    - causing an aq_reset call
    - Base.aq_portal_type = {}
    - [...]
    - return
* local aq_portal_type is not anymore Base.aq_portal_type

The symptoms are random, hard to reproduce loud KeyError crashes in
  hasattr(aq_portal_type[aq_key], accessor_name, None)
that disappear on the second try.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39750 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent e4450c42
......@@ -290,8 +290,9 @@ class WorkflowMethod(Method):
self._invoke_always = {}
def _aq_reset():
Base.aq_method_generated = set()
Base.aq_portal_type = {}
# using clear to prevent changing the reference
Base.aq_method_generated.clear()
Base.aq_portal_type.clear()
Base.aq_related_generated = 0
try:
from Products.ERP5Form.PreferenceTool import PreferenceTool
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment