Merge lp:~allenap/maas/database-locks-revisited-at-start-up--1.5 into lp:maas/1.5

Proposed by Gavin Panella on 2014-06-03
Status: Merged
Approved by: Gavin Panella on 2014-06-03
Approved revision: 2286
Merged at revision: 2286
Proposed branch: lp:~allenap/maas/database-locks-revisited-at-start-up--1.5
Merge into: lp:maas/1.5
Diff against target: 26 lines (+7/-3)
1 file modified
src/maasserver/start_up.py (+7/-3)
To merge this branch: bzr merge lp:~allenap/maas/database-locks-revisited-at-start-up--1.5
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve on 2014-06-03
Review via email: mp+221916@code.launchpad.net

Commit message

Backport of trunk r2400: Lock for start-up in a transaction.

MAAS's database locking code has become more strict and fixing this was missed out.

To post a comment you must log in.
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/maasserver/start_up.py'
--- src/maasserver/start_up.py 2014-04-15 07:42:50 +0000
+++ src/maasserver/start_up.py 2014-06-03 15:54:57 +0000
@@ -18,7 +18,10 @@
1818
19from textwrap import dedent19from textwrap import dedent
2020
21from django.db import connection21from django.db import (
22 connection,
23 transaction,
24 )
22from maasserver import (25from maasserver import (
23 eventloop,26 eventloop,
24 locks,27 locks,
@@ -51,8 +54,9 @@
51 but this method uses file-based locking to ensure that the methods it calls54 but this method uses file-based locking to ensure that the methods it calls
52 internally are not ran concurrently.55 internally are not ran concurrently.
53 """56 """
54 with locks.startup:57 with transaction.atomic():
55 inner_start_up()58 with locks.startup:
59 inner_start_up()
5660
57 eventloop.start().wait(10)61 eventloop.start().wait(10)
5862

Subscribers

People subscribed via source and target branches

to all changes: