[Zope-dev] Re: KeyError in ZRDB.DA cache handling

J Cameron Cooper jccooper at rice.edu
Tue Jan 15 11:01:29 EST 2008


Chris Withers wrote:
> Hi there,
> 
> J Cameron Cooper wrote:
>> but we have that fix in our Zope 2.9.8:
>>   http://osdir.com/ml/web.zope.all-cvs/2006-11/msg00150.html
> 
> Are you absolutely sure you're using a version of Zope with my patches 
> included?

Yes; I've checked both version (this went in for 2.9.6) and for that 
specific code. You can even see some of it in the excerpt in the 
original message, which I pasted straight from our production Zope.

I had hoped it was simply missing the fix, too, but no dice. Now, I 
can't guarantee that the fix in question has remained working since it 
was checked in, but the release code looks much like the the patch.

>> Perhaps it is another high-load leak? I don't think it can be multiple 
>> threads doing cleanup at the same time, unless maybe there's a 
>> transaction commit in there somewhere I don't know about.
> 
> I'm afraid it's long enough ago that this code was touched that I can't 
> really comment on this bit :-S
> 
>> Or maybe I'm running into the problem described in the big comment at 
>> the end?::
> 
> Don't think so, this describes a leak, not a cause of exceptions...
> 
>> Would it be unsafe to toss a try/except around the del cache[q] bit on 
>> the theory that it's already deleted, so, hey, why fail? It'd be 
>> really nice to keep this off of users, even with it if does cause a 
>> bit of a leak.
> 
> Not sure about the try/except, would be better to nail why the key isn't 
> there...

I agree, of course, but these do end up being user visible, and a 
workaround, as long as it's not going to cause worse things, would be nice.

Something like the original workaround in the bug might be in order for 
me (rather than a try/except) until the real fix is found.

http://launchpadlibrarian.net/9460742/Zope-2.8.6-cached-result.patch

I don't imagine it can cause more than cache bloat, and we restart 
enough that that shouldn't kill us.

> Best bet is to start trying to reproduce this in a unit test, 
> which can be pretty hard :-S

Yes, indeed. I did notice that the test you mention in:

https://bugs.launchpad.net/zope2/+bug/143805

doesn't seem to exist, at least in my version.

>> I'll probably be setting up some logging to try and characterize this 
>> further,
> 
> Any results from this?

I haven't yet inserted anything in production (I get funny looks at the 
suggestion) but we'll be trying to cause it in a development system soon.

            --jcc

-- 
Connexions
http://cnx.org

"Building Websites with Plone"
http://plonebook.packtpub.com



More information about the Zope-Dev mailing list