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
1bdd733c
Commit
1bdd733c
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
a08d51b3
Changes
6
Hide 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 @
1bdd733c
...
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
...
@@ -11,6 +11,9 @@ http://docs.zope.org/zope2/releases/.
Bugs Fixed
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
- LP #143403: Prevent accidental acquisition of objectValues during
recursive ownership changes when the changed object has no
recursive ownership changes when the changed object has no
objectValues method.
objectValues method.
...
...
src/Products/StandardCacheManagers/AcceleratedHTTPCacheManager.py
View file @
1bdd733c
...
@@ -172,6 +172,10 @@ class AcceleratedHTTPCacheManager (CacheManager, SimpleItem):
...
@@ -172,6 +172,10 @@ class AcceleratedHTTPCacheManager (CacheManager, SimpleItem):
' '
' '
return
self
.
id
return
self
.
id
security
.
declarePrivate
(
'_remove_data'
)
def
_remove_data
(
self
):
caches
.
pop
(
self
.
__cacheid
)
security
.
declarePrivate
(
'_resetCacheId'
)
security
.
declarePrivate
(
'_resetCacheId'
)
def
_resetCacheId
(
self
):
def
_resetCacheId
(
self
):
self
.
__cacheid
=
'%s_%f'
%
(
id
(
self
),
time
.
time
())
self
.
__cacheid
=
'%s_%f'
%
(
id
(
self
),
time
.
time
())
...
...
src/Products/StandardCacheManagers/RAMCacheManager.py
View file @
1bdd733c
...
@@ -380,6 +380,10 @@ class RAMCacheManager (CacheManager, SimpleItem):
...
@@ -380,6 +380,10 @@ class RAMCacheManager (CacheManager, SimpleItem):
' '
' '
return
self
.
id
return
self
.
id
security
.
declarePrivate
(
'_remove_data'
)
def
_remove_data
(
self
):
caches
.
pop
(
self
.
__cacheid
)
security
.
declarePrivate
(
'_resetCacheId'
)
security
.
declarePrivate
(
'_resetCacheId'
)
def
_resetCacheId
(
self
):
def
_resetCacheId
(
self
):
self
.
__cacheid
=
'%s_%f'
%
(
id
(
self
),
time
.
time
())
self
.
__cacheid
=
'%s_%f'
%
(
id
(
self
),
time
.
time
())
...
...
src/Products/StandardCacheManagers/configure.zcml
View file @
1bdd733c
...
@@ -5,9 +5,20 @@
...
@@ -5,9 +5,20 @@
OFS.interfaces.IObjectClonedEvent"
OFS.interfaces.IObjectClonedEvent"
handler="Products.StandardCacheManagers.subscribers.cloned" />
handler="Products.StandardCacheManagers.subscribers.cloned" />
<subscriber
for="Products.StandardCacheManagers.RAMCacheManager.RAMCacheManager
zope.lifecycleevent.ObjectRemovedEvent"
handler="Products.StandardCacheManagers.subscribers.removed" />
<subscriber
<subscriber
for="Products.StandardCacheManagers.AcceleratedHTTPCacheManager.AcceleratedHTTPCacheManager
for="Products.StandardCacheManagers.AcceleratedHTTPCacheManager.AcceleratedHTTPCacheManager
OFS.interfaces.IObjectClonedEvent"
OFS.interfaces.IObjectClonedEvent"
handler="Products.StandardCacheManagers.subscribers.cloned" />
handler="Products.StandardCacheManagers.subscribers.cloned" />
<subscriber
for="Products.StandardCacheManagers.AcceleratedHTTPCacheManager.AcceleratedHTTPCacheManager
zope.lifecycleevent.ObjectRemovedEvent"
handler="Products.StandardCacheManagers.subscribers.removed" />
</configure>
</configure>
src/Products/StandardCacheManagers/subscribers.py
View file @
1bdd733c
...
@@ -22,3 +22,5 @@ def cloned(obj, event):
...
@@ -22,3 +22,5 @@ def cloned(obj, event):
"""
"""
obj
.
_resetCacheId
()
obj
.
_resetCacheId
()
def
removed
(
obj
,
event
):
obj
.
_remove_data
()
src/Products/StandardCacheManagers/tests/test_CacheManagerLocation.py
View file @
1bdd733c
...
@@ -112,7 +112,11 @@ class CacheManagerLocationTests(CopySupportTestBase):
...
@@ -112,7 +112,11 @@ class CacheManagerLocationTests(CopySupportTestBase):
cache_moved
=
cachemanager_moved
.
ZCacheManager_getCache
()
cache_moved
=
cachemanager_moved
.
ZCacheManager_getCache
()
self
.
assertEqual
(
cache
,
cache_moved
)
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
):
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