Closed petschki closed 11 months ago
since there are two unmerged attempts to fix the stack overflow from @ale-rt (https://github.com/plone/plone.dexterity/pull/107, https://github.com/plone/plone.dexterity/pull/108) and various bits from @jensens (https://github.com/plone/plone.dexterity/pull/119) could you guys give me a hint how to fix this again with DX-Site-Root in Plone 6?
btw. the test_browser
test written by @rpatterson is failing again now in plone6 ...
Since it starts in ...plone/dexterity/content.py", line 163 in __get__
accessing the schema cache and this first run into the volatile
decorator I would suspect the problem occurs in here. I do not now why this is not reflected in the traceback? But at least I would put the debugger there and step into/through here and watch whats happens:
https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/schema.py#L88
I think my PRs are now obsoleted by the refactoring made by Jens. Anyway IIRC the problem was getting the FTI has an utility. See https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/schema.py#L74.
interesting ... in Python 3.8 I do get a traceback ... py3.7 -> stack overflow:
...
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
result = _wrap(result, registry)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
parent = _recurse_to_site(current_site, registry_site)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
current = _recurse_to_site(get_parent(current), wanted)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
if IRoot.providedBy(obj):
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 163, in __get__
SCHEMA_CACHE.modified(portal_type),
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 100, in decorator
fti = lookup_fti(portal_type, cache=self.cache_enabled)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 74, in lookup_fti
fti_cache[portal_type] = fti = queryUtility(
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 169, in queryUtility
return getSiteManager(context).queryUtility(interface, name, default)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.interface-5.4.0-py3.8.egg/zope/interface/registry.py", line 287, in queryUtility
return self.utilities.lookup((), provided, name, default)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
result = _wrap(result, registry)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
parent = _recurse_to_site(current_site, registry_site)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
current = _recurse_to_site(get_parent(current), wanted)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
if IRoot.providedBy(obj):
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 163, in __get__
SCHEMA_CACHE.modified(portal_type),
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 100, in decorator
fti = lookup_fti(portal_type, cache=self.cache_enabled)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 74, in lookup_fti
fti_cache[portal_type] = fti = queryUtility(
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 169, in queryUtility
return getSiteManager(context).queryUtility(interface, name, default)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.interface-5.4.0-py3.8.egg/zope/interface/registry.py", line 287, in queryUtility
return self.utilities.lookup((), provided, name, default)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
result = _wrap(result, registry)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
parent = _recurse_to_site(current_site, registry_site)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
current = _recurse_to_site(get_parent(current), wanted)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
if IRoot.providedBy(obj):
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 163, in __get__
SCHEMA_CACHE.modified(portal_type),
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 100, in decorator
fti = lookup_fti(portal_type, cache=self.cache_enabled)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/schema.py", line 74, in lookup_fti
fti_cache[portal_type] = fti = queryUtility(
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.component-4.6.2-py3.8.egg/zope/component/_api.py", line 169, in queryUtility
return getSiteManager(context).queryUtility(interface, name, default)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/zope.interface-5.4.0-py3.8.egg/zope/interface/registry.py", line 287, in queryUtility
return self.utilities.lookup((), provided, name, default)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 60, in _uncached_lookup
result = _wrap(result, registry)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 159, in _wrap
parent = _recurse_to_site(current_site, registry_site)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/registry.py", line 114, in _recurse_to_site
current = _recurse_to_site(get_parent(current), wanted)
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/five.localsitemanager-3.2.2-py3.8.egg/five/localsitemanager/utils.py", line 15, in get_parent
if IRoot.providedBy(obj):
File "/Volumes/WORKSPACE2/buildout.coredev-6.0-3.8/eggs/plone.dexterity-2.10.3-py3.8.egg/plone/dexterity/content.py", line 134, in __get__
spec = getattr(inst, "__provides__", None)
RecursionError: maximum recursion depth exceeded while calling a Python object
I think my PRs are now obsoleted by the refactoring made by Jens. Anyway IIRC the problem was getting the FTI has an utility. See https://github.com/plone/plone.dexterity/blob/master/plone/dexterity/schema.py#L74.
At this line queryUtility
possibly interferes with the attribute-getter of DX in some way (while looking up the site-manager and its local registries in order to use ZCA). Maybe its worth to try to check if this is the case.
like this return getSiteManager(context).queryUtility(interface, name, default)
@ale-rt inspired by your attempt here https://github.com/plone/plone.dexterity/pull/108 I was able to fix this issue with this https://github.com/plone/plone.dexterity/pull/155 though I think it needs to be clarified, why the IDexterityFTI lookup for Plone Site
doesn't work on the first requests ...
instance gets killed with
stack overflow
traceback: