SVN: ZODB/trunk/src/ Bug fixed:

Jim Fulton <[email protected]>
Newsgroups gmane.comp.python.zope.zodb.cvs
Message-ID <[email protected]>
Log message for revision 103190:
  Bug fixed:
    Certain ZEO server errors could cause a client to get into a state
    where it couldn't commit transactions.
    https://bugs.launchpad.net/zodb/+bug/374737
  

Changed:
  U   ZODB/trunk/src/CHANGES.txt
  U   ZODB/trunk/src/ZEO/StorageServer.py

-=-
Modified: ZODB/trunk/src/CHANGES.txt
===================================================================
--- ZODB/trunk/src/CHANGES.txt	2009-08-25 09:01:56 UTC (rev 103189)
+++ ZODB/trunk/src/CHANGES.txt	2009-08-25 11:01:46 UTC (rev 103190)
@@ -41,6 +41,10 @@
   Changed its sort parameter list to match that of its (Python 2.4+)
   UserList base class.
 
+- Certain ZEO server errors could cause a client to get into a state
+  where it couldn't commit transactions.
+  https://bugs.launchpad.net/zodb/+bug/374737
+
 3.9.0b5 (2009-08-06)
 ====================
 

Modified: ZODB/trunk/src/ZEO/StorageServer.py
===================================================================
--- ZODB/trunk/src/ZEO/StorageServer.py	2009-08-25 09:01:56 UTC (rev 103189)
+++ ZODB/trunk/src/ZEO/StorageServer.py	2009-08-25 11:01:46 UTC (rev 103190)
@@ -407,7 +407,7 @@
                 raise StorageTransactionError("Multiple simultaneous tpc_begin"
                                               " requests from one client.")
 
-        self.transaction = t = transaction.Transaction()
+        t = transaction.Transaction()
         t.id = id
         t.user = user
         t.description = description
@@ -421,6 +421,16 @@
         self.store_failed = 0
         self.stats.active_txns += 1
 
+        # Assign the transaction attribute last. This is so we don't
+        # think we've entered TPC until everything is set.  Why?
+        # Because if we have an error after this, the server will
+        # think it is in TPC and the client will think it isn't.  At
+        # that point, the client will keep trying to enter TPC and
+        # server won't let it.  Errors *after* the tpc_begin call will
+        # cause the client to abort the transaction.
+        # (Also see https://bugs.launchpad.net/zodb/+bug/374737.)
+        self.transaction = t
+
     def tpc_finish(self, id):
         if not self._check_tid(id):
             return
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.