[LNT] r231013 - Reduce the chance of two concurrent submissions breaking the database

Chris Matthews cmatthews5 at apple.com
Mon Mar 2 13:14:23 PST 2015


Author: cmatthews
Date: Mon Mar  2 15:14:23 2015
New Revision: 231013

URL: http://llvm.org/viewvc/llvm-project?rev=231013&view=rev
Log:
Reduce the chance of two concurrent submissions breaking the database

Currently, two concurrent submission can occasionally insert two identical
Orders into the order table. Though rare, this happens monthly on our server.

This fix reduces the chance of that happening by decreasing the length of the
atomic path.  Though this is not a perfect fix, it is simpler than trying to build
up some transaction mechanism on top of the current database schema, which
does not define revisions as unique.

Modified:
    lnt/trunk/lnt/server/db/testsuitedb.py

Modified: lnt/trunk/lnt/server/db/testsuitedb.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuitedb.py?rev=231013&r1=231012&r2=231013&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/testsuitedb.py (original)
+++ lnt/trunk/lnt/server/db/testsuitedb.py Mon Mar  2 15:14:23 2015
@@ -527,9 +527,9 @@ supplied run is missing required run par
             # If not, then we need to insert this order into the total ordering
             # linked list.
 
-            # Add the new order and flush, to assign an ID.
+            # Add the new order and commit, to assign an ID.
             self.add(order)
-            self.v4db.session.flush()
+            self.v4db.session.commit()
 
             # Load all the orders.
             orders = list(self.query(self.Order))





More information about the llvm-commits mailing list