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
=== modified file 'src/maasserver/models/tests/test_interface.py'
--- src/maasserver/models/tests/test_interface.py 2015-12-04 16:54:13 +0000
+++ src/maasserver/models/tests/test_interface.py 2015-12-09 11:46:25 +0000
@@ -58,6 +58,7 @@
58from maasserver.testing.testcase import MAASServerTestCase58from maasserver.testing.testcase import MAASServerTestCase
59from maasserver.utils.orm import get_one59from maasserver.utils.orm import get_one
60from maastesting.matchers import (60from maastesting.matchers import (
61 MockAnyCall,
61 MockCalledOnceWith,62 MockCalledOnceWith,
62 MockCallsMatch,63 MockCallsMatch,
63 MockNotCalled,64 MockNotCalled,
@@ -2571,9 +2572,10 @@
2571 interface.claim_static_ips()2572 interface.claim_static_ips()
2572 self.assertThat(2573 self.assertThat(
2573 mock_link_subnet,2574 mock_link_subnet,
2574 MockCallsMatch(2575 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
2575 call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),2576 self.assertThat(
2576 call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))2577 mock_link_subnet,
2578 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
25772579
2578 def test__without_address_calls_link_subnet_once_per_subnet(self):2580 def test__without_address_calls_link_subnet_once_per_subnet(self):
2579 nodegroup = factory.make_NodeGroup(status=NODEGROUP_STATUS.ENABLED)2581 nodegroup = factory.make_NodeGroup(status=NODEGROUP_STATUS.ENABLED)
@@ -2607,9 +2609,10 @@
2607 interface.claim_static_ips()2609 interface.claim_static_ips()
2608 self.assertThat(2610 self.assertThat(
2609 mock_link_subnet,2611 mock_link_subnet,
2610 MockCallsMatch(2612 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
2611 call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),2613 self.assertThat(
2612 call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))2614 mock_link_subnet,
2615 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
26132616
2614 def test__without_address_does_nothing_if_none_managed(self):2617 def test__without_address_does_nothing_if_none_managed(self):
2615 interface = factory.make_Interface(INTERFACE_TYPE.PHYSICAL)2618 interface = factory.make_Interface(INTERFACE_TYPE.PHYSICAL)
@@ -2691,9 +2694,10 @@
2691 device_interface.claim_static_ips()2694 device_interface.claim_static_ips()
2692 self.assertThat(2695 self.assertThat(
2693 mock_link_subnet,2696 mock_link_subnet,
2694 MockCallsMatch(2697 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
2695 call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),2698 self.assertThat(
2696 call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))2699 mock_link_subnet,
2700 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
26972701
2698 def test__device_no_address_calls_link_subnet_once_per_subnet(self):2702 def test__device_no_address_calls_link_subnet_once_per_subnet(self):
2699 nodegroup = factory.make_NodeGroup(status=NODEGROUP_STATUS.ENABLED)2703 nodegroup = factory.make_NodeGroup(status=NODEGROUP_STATUS.ENABLED)
@@ -2734,9 +2738,10 @@
2734 device_interface.claim_static_ips()2738 device_interface.claim_static_ips()
2735 self.assertThat(2739 self.assertThat(
2736 mock_link_subnet,2740 mock_link_subnet,
2737 MockCallsMatch(2741 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v4))
2738 call(INTERFACE_LINK_TYPE.STATIC, subnet_v4),2742 self.assertThat(
2739 call(INTERFACE_LINK_TYPE.STATIC, subnet_v6)))2743 mock_link_subnet,
2744 MockAnyCall(INTERFACE_LINK_TYPE.STATIC, subnet_v6))
27402745
2741 def test__device_with_address_calls_link_subnet_with_ip_address(self):2746 def test__device_with_address_calls_link_subnet_with_ip_address(self):
2742 parent = factory.make_Node()2747 parent = factory.make_Node()
27432748
=== modified file 'src/provisioningserver/rpc/boot_images.py'
--- src/provisioningserver/rpc/boot_images.py 2015-11-11 02:29:30 +0000
+++ src/provisioningserver/rpc/boot_images.py 2015-12-09 11:46:25 +0000
@@ -54,7 +54,8 @@
54 most up-to-date boot images list."""54 most up-to-date boot images list."""
55 global CACHED_BOOT_IMAGES55 global CACHED_BOOT_IMAGES
56 with ClusterConfiguration.open() as config:56 with ClusterConfiguration.open() as config:
57 CACHED_BOOT_IMAGES = tftppath.list_boot_images(config.tftp_root)57 tftp_root = config.tftp_root
58 CACHED_BOOT_IMAGES = tftppath.list_boot_images(tftp_root)
5859
5960
60def get_hosts_from_sources(sources):61def get_hosts_from_sources(sources):

Subscribers

People subscribed via source and target branches