Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
ef638278
Commit
ef638278
authored
Jun 16, 2010
by
Jens Vagelpohl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- LP #143619: Make sure to remove a RAMCache's contents when the
ZODB object is removed.
parent
b13cf2ce
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
1 deletion
+29
-1
doc/CHANGES.rst
doc/CHANGES.rst
+3
-0
src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
...ucts/StandardCacheManagers/AcceleratedHTTPCacheManager.py
+4
-0
src/Products/StandardCacheManagers/RAMCacheManager.py
src/Products/StandardCacheManagers/RAMCacheManager.py
+4
-0
src/Products/StandardCacheManagers/configure.zcml
src/Products/StandardCacheManagers/configure.zcml
+11
-0
src/Products/StandardCacheManagers/subscribers.py
src/Products/StandardCacheManagers/subscribers.py
+2
-0
src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
.../StandardCacheManagers/tests/test_CacheManagerLocation.py
+5
-1
No files found.
doc/CHANGES.rst
View file @
ef638278
...
...
@@ -181,6 +181,9 @@ Features Added
Bugs Fixed
++++++++++
- LP #143619: Make sure to remove a RAMCache'
s
contents
when
the
ZODB
object
is
removed
.
-
LP
#
143403
:
Prevent
accidental
acquisition
of
objectValues
during
recursive
ownership
changes
when
the
changed
object
has
no
objectValues
method
.
...
...
src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
View file @
ef638278
...
...
@@ -172,6 +172,10 @@ class AcceleratedHTTPCacheManager (CacheManager, SimpleItem):
' '
return
self
.
id
security
.
declarePrivate
(
'_remove_data'
)
def
_remove_data
(
self
):
caches
.
pop
(
self
.
__cacheid
)
security
.
declarePrivate
(
'_resetCacheId'
)
def
_resetCacheId
(
self
):
self
.
__cacheid
=
'%s_%f'
%
(
id
(
self
),
time
.
time
())
...
...
src/Products/StandardCacheManagers/RAMCacheManager.py
View file @
ef638278
...
...
@@ -380,6 +380,10 @@ class RAMCacheManager (CacheManager, SimpleItem):
' '
return
self
.
id
security
.
declarePrivate
(
'_remove_data'
)
def
_remove_data
(
self
):
caches
.
pop
(
self
.
__cacheid
)
security
.
declarePrivate
(
'_resetCacheId'
)
def
_resetCacheId
(
self
):
self
.
__cacheid
=
'%s_%f'
%
(
id
(
self
),
time
.
time
())
...
...
src/Products/StandardCacheManagers/configure.zcml
View file @
ef638278
...
...
@@ -5,9 +5,20 @@
OFS.interfaces.IObjectClonedEvent"
handler="Products.StandardCacheManagers.subscribers.cloned" />
<subscriber
for="Products.StandardCacheManagers.RAMCacheManager.RAMCacheManager
zope.lifecycleevent.ObjectRemovedEvent"
handler="Products.StandardCacheManagers.subscribers.removed" />
<subscriber
for="Products.StandardCacheManagers.AcceleratedHTTPCacheManager.AcceleratedHTTPCacheManager
OFS.interfaces.IObjectClonedEvent"
handler="Products.StandardCacheManagers.subscribers.cloned" />
<subscriber
for="Products.StandardCacheManagers.AcceleratedHTTPCacheManager.AcceleratedHTTPCacheManager
zope.lifecycleevent.ObjectRemovedEvent"
handler="Products.StandardCacheManagers.subscribers.removed" />
</configure>
src/Products/StandardCacheManagers/subscribers.py
View file @
ef638278
...
...
@@ -22,3 +22,5 @@ def cloned(obj, event):
"""
obj
.
_resetCacheId
()
def
removed
(
obj
,
event
):
obj
.
_remove_data
()
src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
View file @
ef638278
...
...
@@ -112,7 +112,11 @@ class CacheManagerLocationTests(CopySupportTestBase):
cache_moved
=
cachemanager_moved
.
ZCacheManager_getCache
()
self
.
assertEqual
(
cache
,
cache_moved
)
# XXX test cache is removed if cachemanager is deleted to prevent leaks?
def
test_cache_deleted_on_remove
(
self
):
old_cache
=
self
.
cachemanager
.
ZCacheManager_getCache
()
self
.
folder1
.
manage_delObjects
([
'cache'
])
new_cache
=
self
.
cachemanager
.
ZCacheManager_getCache
()
self
.
assertNotEqual
(
old_cache
,
new_cache
)
class
AcceleratedHTTPCacheManagerLocationTests
(
CacheManagerLocationTests
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment