On 12/14/05, Tim Peters <[EMAIL PROTECTED]> wrote:
> Jeremy, the code at the start of _setstate() looks fishy:  any idea what the
> intent was?:
>         # There is a harmless data race with self._invalidated.  A
>         # dict update could go on in another thread, but we don't care
>         # because we have to check again after the load anyway.
>         if (obj._p_oid in self._invalidated
>             and not myhasattr(obj, "_p_independent")
>             and not self._invalidated
>             ):
>             # If the object has _p_independent(), we will handle it below.
>             self._load_before_or_conflict(obj)
>             return

I don't have any idea what the intent of "not self._invalidated" was. 
I looked back at 3.3a2, which I think was the first MVCC release.  It
doesn't have the "and not self._invalidated" line , and I can't think
of why it would.  The code is just an optimization; it's trying to
avoid loading the current version if it knows that it needs a
non-current version.

I don't have a checkout of ZODB, so I can't check the svn blame.  Does
it say who wrote the code and what change it was related to?


> Specifically, how could:
>     obj._p_oid in self._invalidated
> and:
>     not self._invalidated
> be true at the same time?  The latter says _invalidated is empty, but the
> former can't be true if _invalidated is empty.  Offhand, then, unless we're
> _counting_ on a thread race here ;-), it looks impossible that the body of
> this `if` could execute.
> I don't have a reason to believe it's directly relevant to Chris's problem,
> it's just that I got baffled by the first thing I looked at ;-)
For more information about ZODB, see the ZODB Wiki:

ZODB-Dev mailing list  -  ZODB-Dev@zope.org

Reply via email to