Re: Silva2.3 / NotYet exception

Sylvain Viollon <[email protected]> Tue, 20 Sep 2011 09:31:47 +0200
Newsgroups gmane.comp.web.zope.silva.devel
Message-ID <[email protected]>
Op 19 sep 2011, om 22:17 heeft Andrew Altepeter het volgende geschreven:

> Greetings,
> 

   Hello,

> I'm sure you know we're running Silva 2.3.  From time to time since the
> upgrade we've seen a "NotYet" error appear in the error log. I haven't been
> able to track it down or reproduce it until just now.  What follows is the
> traceback -- this is on a page with an InlineNewsViewer pointing to an
> AgendaViewer.  I don't know what this error means, but it is preventing the
> source from displaying on the page:
> 

   A not yet error comes from the references, more precisely the int ids. In Zope 3, you can get a not yet exception
if you ask an int id of an object which is not already set in the ZODB. You always need to do setObject before asking an int id. In Zope 3, an int id identify a ZODB object. You can get its location (path) using the location API and going up its __parent__.

   In Zope 2, you have no location API, and no __parent__ for regular ZODB object used as content. So an int id identify a ZODB object and its path, that his reconstructed using acquisition when you fetch it, in order to get its location.  There is an extra rule, that triggers a not yet exception, that have been added for safety, that if you try to get an int id of an object that have at least two time the same ZODB object in its acquisition path, it fails with this exception (this rule haven't been added by me, it is in five.intid).

   References do ask the int id of the target and the source of the reference.

   So in Silva 2.3, if you have a document in /root, you can render /root/document, but /root/document/document will fail. 

   In SilvaNews, viewers are linked to filters using references (that doesn't break if you move around filters, and that manage deletion cases and so on).
   
   Reading from the traceback, I see it is a code source, I would say that the hardcoded path to the viewer as a parameter has at least two time the same ZODB object in its path (seems to be admissions here with ..../admissions/visit/events/admissions/cas-admissions-events-viewer). I would rather fix that parameter than something else (we would need to have something that clean the acquisition path to do it automatically).

   Hopefully in Silva 3.0, you have a reference field for code sources, so this doesn't happen anymore.

   Regards,

   Sylvain,

-- 
Sylvain Viollon -- Infrae
t +31 10 243 7051 -- http://infrae.com
Hoevestraat 10 3033GC Rotterdam -- The Netherlands