Merge lp:~allenap/maas/reload-boot-images-without-holding-config-lock--1.9 into lp:maas/1.9

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 4526
Proposed branch: lp:~allenap/maas/reload-boot-images-without-holding-config-lock--1.9
Merge into: lp:maas/1.9
Diff against target: 81 lines (+19/-13)
2 files modified
src/maasserver/models/tests/test_interface.py (+17/-12)
src/provisioningserver/rpc/boot_images.py (+2/-1)
To merge this branch: bzr merge lp:~allenap/maas/reload-boot-images-without-holding-config-lock--1.9
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+279993@code.launchpad.net

Commit message

Don't hold the cluster configuration lock while reloading boot images.

From inspection, this was the single remaining operation left in MAAS's code base that does something that might possibly be slow whilst also holding the configuration lock.

This also fixes some unrelated flaky tests which were preventing landing.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Download full text (1017.1 KiB)

The attempt to merge lp:~allenap/maas/reload-boot-images-without-holding-config-lock--1.9 into lp:maas/1.9 failed. Below is the output from the failed tests.

Ign http://prodstack-zone-2.clouds.archive.ubuntu.com trusty InRelease
Get:1 http://security.ubuntu.com trusty-security InRelease [64.4 kB]
Get:2 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates InRelease [64.4 kB]
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports InRelease
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty Release.gpg
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty Release
Get:3 http://security.ubuntu.com trusty-security/main Sources [101 kB]
Get:4 http://security.ubuntu.com trusty-security/universe Sources [31.9 kB]
Get:5 http://security.ubuntu.com trusty-security/main amd64 Packages [382 kB]
Get:6 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/main Sources [247 kB]
Get:7 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/restricted Sources [5,359 B]
Get:8 http://security.ubuntu.com trusty-security/universe amd64 Packages [120 kB]
Get:9 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/universe Sources [144 kB]
Get:10 http://security.ubuntu.com trusty-security/main Translation-en [208 kB]
Get:11 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/multiverse Sources [5,167 B]
Get:12 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/main amd64 Packages [665 kB]
Get:13 http://security.ubuntu.com trusty-security/universe Translation-en [70.1 kB]
Get:14 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/restricted amd64 Packages [15.9 kB]
Get:15 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/universe amd64 Packages [329 kB]
Get:16 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/multiverse amd64 Packages [13.0 kB]
Get:17 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/main Translation-en [329 kB]
Get:18 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/multiverse Translation-en [6,832 B]
Get:19 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/restricted Translation-en [3,699 B]
Get:20 http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-updates/universe Translation-en [173 kB]
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/main Sources
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/restricted Sources
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/universe Sources
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/multiverse Sources
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/main amd64 Packages
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/restricted amd64 Packages
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/universe amd64 Packages
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/multiverse amd64 Packages
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trusty-backports/main Translation-en
Hit http://prodstack-zone-2.clouds.archive.ubuntu.com trust...

Revision history for this message
Gavin Panella (allenap) wrote :

Two flaky tests in maasserver.models.tests.test_interface.TestClaimStaticIPs:

  test__device_no_address_calls_link_subnet_once_per_subnet
  test__without_address_calls_link_subnet_once_per_subnet

(I suspect an ordering issue.)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/maasserver/models/tests/test_interface.py'
2--- src/maasserver/models/tests/test_interface.py 2015-12-04 16:54:13 +0000
3+++ src/maasserver/models/tests/test_interface.py 2015-12-09 11:46:25 +0000
4@@ -58,6 +58,7 @@
5 from maasserver.testing.testcase import MAASServerTestCase
6 from maasserver.utils.orm import get_one
7 from maastesting.matchers import (
8+ MockAnyCall,
9 MockCalledOnceWith,
10 MockCallsMatch,
11 MockNotCalled,
12@@ -2571,9 +2572,10 @@
13 interface.claim_static_ips()
14 self.assertThat(
15 mock_link_subnet,
16- MockCallsMatch(
17- call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),
18- call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))
19+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
20+ self.assertThat(
21+ mock_link_subnet,
22+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
23
24 def test__without_address_calls_link_subnet_once_per_subnet(self):
25 nodegroup = factory.make_NodeGroup(status=NODEGROUP_STATUS.ENABLED)
26@@ -2607,9 +2609,10 @@
27 interface.claim_static_ips()
28 self.assertThat(
29 mock_link_subnet,
30- MockCallsMatch(
31- call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),
32- call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))
33+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
34+ self.assertThat(
35+ mock_link_subnet,
36+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
37
38 def test__without_address_does_nothing_if_none_managed(self):
39 interface = factory.make_Interface(INTERFACE_TYPE.PHYSICAL)
40@@ -2691,9 +2694,10 @@
41 device_interface.claim_static_ips()
42 self.assertThat(
43 mock_link_subnet,
44- MockCallsMatch(
45- call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),
46- call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))
47+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
48+ self.assertThat(
49+ mock_link_subnet,
50+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
51
52 def test__device_no_address_calls_link_subnet_once_per_subnet(self):
53 nodegroup = factory.make_NodeGroup(status=NODEGROUP_STATUS.ENABLED)
54@@ -2734,9 +2738,10 @@
55 device_interface.claim_static_ips()
56 self.assertThat(
57 mock_link_subnet,
58- MockCallsMatch(
59- call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),
60- call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))
61+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
62+ self.assertThat(
63+ mock_link_subnet,
64+ MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
65
66 def test__device_with_address_calls_link_subnet_with_ip_address(self):
67 parent = factory.make_Node()
68
69=== modified file 'src/provisioningserver/rpc/boot_images.py'
70--- src/provisioningserver/rpc/boot_images.py 2015-11-11 02:29:30 +0000
71+++ src/provisioningserver/rpc/boot_images.py 2015-12-09 11:46:25 +0000
72@@ -54,7 +54,8 @@
73 most up-to-date boot images list."""
74 global CACHED_BOOT_IMAGES
75 with ClusterConfiguration.open() as config:
76- CACHED_BOOT_IMAGES = tftppath.list_boot_images(config.tftp_root)
77+ tftp_root = config.tftp_root
78+ CACHED_BOOT_IMAGES = tftppath.list_boot_images(tftp_root)
79
80
81 def get_hosts_from_sources(sources):

Subscribers

People subscribed via source and target branches