remove sub folder w/ site-manager, but removed folder's "++etc++site" stay in Data.fs

Bug #412332 reported by Shimizukawa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zope 3
Won't Fix
Undecided
Unassigned
zope.app.component
New
Undecided
Unassigned

Bug Description

Data.fs keep reference to removed "++etc++site" object.
Therefore, Data.fs could become huge.

Sample steps:
- Add a folder as 'foo'
- Make a site by 'foo'
- Remove 'foo'
- Still exist /foo/++etc++site object in Data.fs (but it is not traversable)

DocTest like:
>>> from ZODB.serialize import referencesf
>>> def analyze(root_obj):
... conn = root_obj._p_jar
... l_in = [root_obj]
... l_out = []
... while l_in:
... obj = l_in.pop(0)
... p, serial = conn._storage.load(obj._p_oid, conn._version)
... oids = referencesf(p)
... objs = [conn._reader.load_oid(x) for x in oids]
... l_out.append(obj)
... l_in.extend([x for x in objs if x not in l_out and x not in l_in])
... return l_out
...

>>> import transaction
>>> from zope.app.component.hooks import setSite
>>> from zope.app.component.site import LocalSiteManager
>>> from zope.app.folder.folder import Folder

>>> f = Folder()
>>> root['foo'] = f
>>> transaction.commit()
>>> objs = analyze(root)
>>> len([x for x in objs if getattr(x,'__name__','')=='++etc++site'])
1

>>> f = root['foo']
>>> f.setSiteManager(LocalSiteManager(f))
>>> transaction.commit()
>>> objs = analyze(root)
>>> len([x for x in objs if getattr(x,'__name__','')=='++etc++site'])
2

>>> del root['foo']
>>> del f
>>> transaction.commit()
>>> objs = analyze(root)
>>> len([x for x in objs if getattr(x,'__name__','')=='++etc++site'])
2

Expected return value (last line) was 1, but 2.

Changed in zope3:
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.