[LNT] r306321 - migrate.py: Call close_all before applying upgrade scripts
Matthias Braun via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 26 12:40:07 PDT 2017
Author: matze
Date: Mon Jun 26 12:40:07 2017
New Revision: 306321
URL: http://llvm.org/viewvc/llvm-project?rev=306321&view=rev
Log:
migrate.py: Call close_all before applying upgrade scripts
Without this postgres would always hang for me when upgrade_3_to_4 was
manually executing SQL. I assume postgres had the table locked because
of open transactions.
Modified:
lnt/trunk/lnt/server/db/migrate.py
Modified: lnt/trunk/lnt/server/db/migrate.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/migrate.py?rev=306321&r1=306320&r2=306321&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/migrate.py (original)
+++ lnt/trunk/lnt/server/db/migrate.py Mon Jun 26 12:40:07 2017
@@ -148,6 +148,10 @@ def update_schema(engine, session, versi
execfile(upgrade_script, globals)
upgrade_method = globals['upgrade']
+ # Make sure we don't have any transactions lingering when executing
+ # the upgrade script.
+ session.close_all()
+
# Execute the upgrade.
#
# FIXME: Backup the database here.
More information about the llvm-commits
mailing list