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

Proposed by Gavin Panella
Status: Merged
Approved by: Raphaël Badin
Approved revision: no longer in the source branch.
Merged at revision: 2400
Proposed branch: lp:~allenap/maas/database-locks-revisited-at-start-up
Merge into: lp:~maas-committers/maas/trunk
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
Reviewer Review Type Date Requested Status
Julian Edwards (community) Approve
Review via email: mp+221799@code.launchpad.net

Commit message

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.
Revision history for this message
Julian Edwards (julian-edwards) wrote :

It's not immediately obvious to me why this is needed, but if it works then it should land.

review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (45.7 KiB)

The attempt to merge lp:~allenap/maas/database-locks-revisited-at-start-up into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:2 http://security.ubuntu.com trusty-security Release [58.5 kB]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [58.5 kB]
Get:5 http://security.ubuntu.com trusty-security/main Sources [16.6 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Get:6 http://security.ubuntu.com trusty-security/universe Sources [4,212 B]
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Get:7 http://security.ubuntu.com trusty-security/main amd64 Packages [53.2 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [17.9 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Get:9 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [47.6 kB]
Get:10 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [28.6 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [117 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [77.2 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en_US
Fetched 481 kB in 0s (708 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make postgresql python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-formencode python-httplib2 pytho...

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Fuxache Rabbit

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (3.6 KiB)

The attempt to merge lp:~allenap/maas/database-locks-revisited-at-start-up into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com saucy-security InRelease
Hit http://security.ubuntu.com saucy-security Release.gpg
Ign http://nova.clouds.archive.ubuntu.com saucy InRelease
Hit http://security.ubuntu.com saucy-security Release
Ign http://nova.clouds.archive.ubuntu.com saucy-updates InRelease
Hit http://nova.clouds.archive.ubuntu.com saucy Release.gpg
Hit http://nova.clouds.archive.ubuntu.com saucy-updates Release.gpg
Hit http://nova.clouds.archive.ubuntu.com saucy Release
Hit http://nova.clouds.archive.ubuntu.com saucy-updates Release
Hit http://security.ubuntu.com saucy-security/main Sources
Hit http://security.ubuntu.com saucy-security/universe Sources
Hit http://security.ubuntu.com saucy-security/main amd64 Packages
Hit http://security.ubuntu.com saucy-security/universe amd64 Packages
Hit http://security.ubuntu.com saucy-security/main Translation-en
Hit http://security.ubuntu.com saucy-security/universe Translation-en
Hit http://nova.clouds.archive.ubuntu.com saucy/main Sources
Hit http://nova.clouds.archive.ubuntu.com saucy/universe Sources
Hit http://nova.clouds.archive.ubuntu.com saucy/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy/main Translation-en
Ign http://security.ubuntu.com saucy-security/main Translation-en_US
Hit http://nova.clouds.archive.ubuntu.com saucy/universe Translation-en
Ign http://security.ubuntu.com saucy-security/universe Translation-en_US
Hit http://nova.clouds.archive.ubuntu.com saucy-updates/main Sources
Hit http://nova.clouds.archive.ubuntu.com saucy-updates/universe Sources
Hit http://nova.clouds.archive.ubuntu.com saucy-updates/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy-updates/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com saucy-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com saucy-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com saucy/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com saucy-updates/universe Translation-en_US
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make postgresql python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-formencode python-httplib2 python-jinja2 python-jsonschema python-lockfile python-lxml python-netaddr python-netifaces python-oauth python-oops python-oops-amqp python-oops-datedir-repo python-oops-twisted python-oops-wsgi python-pexpect p...

Read more...

Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (108.7 KiB)

The attempt to merge lp:~allenap/maas/database-locks-revisited-at-start-up into lp:maas failed. Below is the output from the failed tests.

Ign http://security.ubuntu.com trusty-security InRelease
Ign http://nova.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://nova.clouds.archive.ubuntu.com trusty-updates InRelease
Get:2 http://security.ubuntu.com trusty-security Release [58.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty Release.gpg
Get:3 http://nova.clouds.archive.ubuntu.com trusty-updates Release.gpg [933 B]
Hit http://nova.clouds.archive.ubuntu.com trusty Release
Get:4 http://nova.clouds.archive.ubuntu.com trusty-updates Release [58.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty/main Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Sources
Hit http://nova.clouds.archive.ubuntu.com trusty/main amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://nova.clouds.archive.ubuntu.com trusty/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en
Get:5 http://security.ubuntu.com trusty-security/main Sources [16.6 kB]
Get:6 http://security.ubuntu.com trusty-security/universe Sources [4,212 B]
Get:7 http://nova.clouds.archive.ubuntu.com trusty-updates/main Sources [49.7 kB]
Get:8 http://security.ubuntu.com trusty-security/main amd64 Packages [53.2 kB]
Get:9 http://security.ubuntu.com trusty-security/universe amd64 Packages [17.9 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Get:10 http://nova.clouds.archive.ubuntu.com trusty-updates/universe Sources [28.6 kB]
Get:11 http://nova.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [126 kB]
Get:12 http://nova.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [77.5 kB]
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en
Hit http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en
Ign http://nova.clouds.archive.ubuntu.com trusty/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://nova.clouds.archive.ubuntu.com trusty-updates/universe Translation-en_US
Fetched 493 kB in 0s (1,812 kB/s)
Reading package lists...
sudo DEBIAN_FRONTEND=noninteractive apt-get -y \
     --no-install-recommends install apache2 bind9 bind9utils build-essential bzr-builddeb curl daemontools debhelper dh-apport distro-info dnsutils firefox freeipmi-tools ipython isc-dhcp-common libjs-raphael libjs-yui3-full libjs-yui3-min libpq-dev make postgresql python-amqplib python-bzrlib python-celery python-convoy python-crochet python-cssselect python-curtin python-dev python-distro-info python-django python-django-piston python-django-south python-djorm-ext-pgarray python-docutils python-formencode python-httplib2 pyt...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/start_up.py'
2--- src/maasserver/start_up.py 2014-05-19 11:53:53 +0000
3+++ src/maasserver/start_up.py 2014-06-02 22:10:48 +0000
4@@ -18,7 +18,10 @@
5
6 from textwrap import dedent
7
8-from django.db import connection
9+from django.db import (
10+ connection,
11+ transaction,
12+ )
13 from maasserver import (
14 eventloop,
15 locks,
16@@ -51,8 +54,9 @@
17 but this method uses file-based locking to ensure that the methods it calls
18 internally are not ran concurrently.
19 """
20- with locks.startup:
21- inner_start_up()
22+ with transaction.atomic():
23+ with locks.startup:
24+ inner_start_up()
25
26 eventloop.start().wait(10)
27