[ZCM] [ZC] 1309/ 9 Comment "ZODB.DB.DB.cacheExtremeDetail reports
wrong reference count"
Collector: Zope Bugs, Features,
and Patches ...
zope-coders-admin at zope.org
Mon May 10 12:09:10 EDT 2004
Issue #1309 Update (Comment) "ZODB.DB.DB.cacheExtremeDetail reports wrong reference count"
Status Resolved, Database/bug low
To followup, visit:
http://zope.org/Collectors/Zope/1309
==============================================================
= Comment - Entry #9 by tim_one on May 10, 2004 12:09 pm
Also checked in on Zope-2_7-branch:
doc/CHANGES.txt revision 1.625.2.143
lib/python/ZODB/DB.py revision 1.53.2.4
lib/python/ZODB/tests/testCache.py revision 1.13.10.3
________________________________________
= Comment - Entry #8 by d.maurer on May 8, 2004 1:05 pm
The patch is fine, indeed better than fine -- it is excellent :-)
________________________________________
= Resolve - Entry #7 by tim_one on May 7, 2004 3:12 pm
Status: Accepted => Resolved
After sleeping on it, the patch seems reasonable enough to me, so checked it in.
NEWS.txt revision 1.8
src/ZODB/DB.py revision 1.79
src/ZODB/tests/testCache.py revision 1.24
________________________________________
= Comment - Entry #6 by tim_one on May 6, 2004 9:57 pm
Uploaded: "patch.txt"
- http://zope.org/Collectors/Zope/1309/patch.txt/view
Dieter, please let me know whether the attached patch implements your belief about what this should do.
________________________________________
= Comment - Entry #5 by tim_one on May 6, 2004 4:26 pm
I think I'm hung up trying to guess what this stuff thinks it's *trying* to achieve. If it wants to return the object's true Python refcount, then s/4/3/ is correct. If it's trying to show a fudged refcount, based on some undocumented goal, then anything goes. I suppose the story is that it's trying to show what the true refcount *would* have been if the cache didn't exist? That's the only way I can make sense of what you're saying (and that's fine, if that is indeed what it's trying to do).
________________________________________
= Comment - Entry #4 by d.maurer on May 5, 2004 5:23 pm
It is too small only for ghost objects.
1. It subtracts 4 because (for non ghost objects) the cache keeps an additional reference
2. for non-ghosts, the cache keeps an additional reference, for ghosts, it does not
________________________________________
= Comment - Entry #3 by tim_one on May 4, 2004 4:33 pm
I'm pretty baffled by this code. Do you think it's too small *only* for ghost objects, or for all objects? I count 3 temp references due to the routine itself: being bound to name "ob", passing ob to sys.getrefcount(), and appearing once in the con._cache_items() list. So I'm unclear on two things:
1. Why the routine subtracts 4.
2. Why there should be (or is) a difference between
ghost and non-ghost objects.
It's easy to s/4/3/, but if that does a wrong thing for non-ghosts, it's not a right thing to do.
________________________________________
= Assign - Entry #2 by tim_one on May 4, 2004 2:31 pm
Status: Pending => Accepted
Supporters added: tim_one
Assigned to me.
________________________________________
= Request - Entry #1 by d.maurer on May 4, 2004 4:44 am
The reference count reported by
ZODB.DB.DB.cacheExtremeDetails is by 1 too low for ghost objects
==============================================================
More information about the Zope-Collector-Monitor
mailing list