From b90575d8e9b8001b1dc7ae5cfb4cc77e74151b69 Mon Sep 17 00:00:00 2001 From: Adam Gandelman Date: Tue, 14 Feb 2012 17:01:59 -0800 Subject: [PATCH] 003_add_disk_format.py: Avoid deadlock in upgrade The connection used to query existing images needs to be closed earlier to avoid deadlocking later calls thru sqlalchemy. Fixes bug 932466 Update: Update my email in Authors Update: Revert Authors email to original, add git commit email to .mailamp. Change-Id: Ic248fdfe3933437928f0b393d8cde993b96bf2cb --- .mailmap | 1 + glance/registry/db/migrate_repo/versions/003_add_disk_format.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.mailmap b/.mailmap index c239ae4c..efe6b605 100644 --- a/.mailmap +++ b/.mailmap @@ -1,6 +1,7 @@ # Format is: # # + diff --git a/glance/registry/db/migrate_repo/versions/003_add_disk_format.py b/glance/registry/db/migrate_repo/versions/003_add_disk_format.py index 1459cbec..99f8b846 100644 --- a/glance/registry/db/migrate_repo/versions/003_add_disk_format.py +++ b/glance/registry/db/migrate_repo/versions/003_add_disk_format.py @@ -105,6 +105,7 @@ def upgrade(migrate_engine): created_at=record.created_at, deleted=False, value=record.type) + conn.close() disk_format = Column('disk_format', String(20)) disk_format.create(images) @@ -112,7 +113,6 @@ def upgrade(migrate_engine): container_format.create(images) images.columns['type'].drop() - conn.close() def downgrade(migrate_engine):