[Zodb-checkins] SVN: ZODB/trunk/ Merge rev 29879 from 3.4 branch.

Tim Peters tim.one at comcast.net
Mon Apr 4 22:38:38 EDT 2005


Log message for revision 29880:
  Merge rev 29879 from 3.4 branch.
  
  Port from 3.3 branch.
  
  Port from Zope 2.7 branch.
  
  The various flavors of the ``check2ZODBThreads`` and ``check7ZODBThreads``
  tests are much less likely to suffer sproadic failures now.
  

Changed:
  U   ZODB/trunk/NEWS.txt
  U   ZODB/trunk/src/ZODB/tests/MTStorage.py

-=-
Modified: ZODB/trunk/NEWS.txt
===================================================================
--- ZODB/trunk/NEWS.txt	2005-04-05 02:36:33 UTC (rev 29879)
+++ ZODB/trunk/NEWS.txt	2005-04-05 02:38:36 UTC (rev 29880)
@@ -3,6 +3,17 @@
 Release date: DD-MMM-YYYY
 
 
+What's new in ZODB3 3.4xx?
+==========================
+Release date: MM-DDD-2005
+
+Tests
+-----
+
+The various flavors of the ``check2ZODBThreads`` and ``check7ZODBThreads``
+tests are much less likely to suffer sproadic failures now.
+
+
 What's new in ZODB3 3.4a2?
 ==========================
 Release date: 03-Apr-2005
@@ -137,6 +148,17 @@
 FileStorage indices.  Thanks to Chris McDonough for code and tests.
 
 
+What's new in ZODB3 3.3.1?
+==========================
+Release date: DD-MMM-2005
+
+Tests
+-----
+
+The various flavors of the ``check2ZODBThreads`` and ``check7ZODBThreads``
+tests are much less likely to suffer sproadic failures now.
+
+
 What's new in ZODB3 3.3.1c1?
 ============================
 Release date: 01-Apr-2005

Modified: ZODB/trunk/src/ZODB/tests/MTStorage.py
===================================================================
--- ZODB/trunk/src/ZODB/tests/MTStorage.py	2005-04-05 02:36:33 UTC (rev 29879)
+++ ZODB/trunk/src/ZODB/tests/MTStorage.py	2005-04-05 02:38:36 UTC (rev 29880)
@@ -75,23 +75,33 @@
         transaction.commit()
         time.sleep(self.delay)
 
+    # Return a new PersistentMapping, and store it on the root object under
+    # the name (.getName()) of the current thread.
     def get_thread_dict(self, root):
+        # This is vicious:  multiple threads are slamming changes into the
+        # root object, then trying to read the root object, simultaneously
+        # and without any coordination.  Conflict errors are rampant.  It
+        # used to go around at most 10 times, but that fairly often failed
+        # to make progress in the 7-thread tests on some test boxes.  Going
+        # around (at most) 1000 times was enough so that a 100-thread test
+        # reliably passed on Tim's hyperthreaded WinXP box (but at the
+        # original 10 retries, the same test reliably failed with 15 threads).
         name = self.getName()
-        # arbitrarily limit to 10 re-tries
-        for i in range(10):
+        MAXRETRIES = 1000
+
+        for i in range(MAXRETRIES):
             try:
-                m = PersistentMapping()
-                root[name] = m
+                root[name] = PersistentMapping()
                 transaction.commit()
                 break
-            except ConflictError, err:
-                transaction.abort()
+            except ConflictError:
                 root._p_jar.sync()
-        for i in range(10):
+
+        for i in range(MAXRETRIES):
             try:
                 return root.get(name)
             except ConflictError:
-                transaction.abort()
+                root._p_jar.sync()
 
 class StorageClientThread(TestThread):
 



More information about the Zodb-checkins mailing list