I was trying to debug a failing ZEO test case (testConcurrentUpdates),
and found out it had nothing to do with ZEO.  There's a bug either in
BTrees or in ZODB itself that causes data corruption under Python 3.x.

Here's a test case:

It initializes an OOBTree to {0:0, 1:0, 2:0}, then launches two
threads that attempt just one write each:

  tree[1] = 1           # thread 1
  tree[2] = 2           # thread 2

All transactions are committed successfully and the end result _sometimes_
is {0:0, 1:0, 2:2} instead of the expected {0:0, 1:1, 2:2}.

There's also a larger test case (zodbfail.py) that modifies more than
one item in a thread.  That one fails pretty reliably.

This only happens under Python 3.x.

To reproduce::

  git clone git://gist.github.com/5644876.git zodbfail
  cd zodbfail

Marius Gedminas
Frameworks ought to gracefully fade away as you replace them, bit by bit, with
domain-specific code
        -- Jacob Kaplan-Moss

Attachment: signature.asc
Description: Digital signature

For more information about ZODB, see http://zodb.org/

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

Reply via email to