Merge lp:~rcj/launchpad-buildd/lp1852518 into lp:launchpad-buildd

Proposed by Robert C Jennings
Status: Merged
Approved by: Colin Watson
Approved revision: 399
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~rcj/launchpad-buildd/lp1852518
Merge into: lp:launchpad-buildd
Diff against target: 48 lines (+19/-0)
3 files modified
debian/changelog (+6/-0)
lpbuildd/target/lxd.py (+7/-0)
lpbuildd/target/tests/test_lxd.py (+6/-0)
To merge this branch: bzr merge lp:~rcj/launchpad-buildd/lp1852518
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+375529@code.launchpad.net

Commit message

LXD: Create dm-X devices to address kpartx hangs (LP: #1852518)

On focal kpartx looks for dm devices and hangs in their absense.

To post a comment you must log in.
Revision history for this message
Robert C Jennings (rcj) wrote :

WIP to pursue a fix in the distro rather than add a work-around

Revision history for this message
Robert C Jennings (rcj) wrote :

With the rejection of an upstream bug https://github.com/systemd/systemd/issues/14033 could you reconsider this MP?

The presence of the device nodes is a sufficient workaround and the alternative workaround in the binary hooks, like https://code.launchpad.net/~mwhudson/livecd-rootfs/+git/livecd-rootfs/+merge/375588, is less pleasant (plus it has to be fixed in a number of places). Thank you.

Revision history for this message
Colin Watson (cjwatson) wrote :

I'm OK with this in principle, but this change breaks the test suite. Could you fix that, please? (Use "make check" in a xenial container with launchpad-buildd's build-deps installed.)

======================================================================
FAIL: lpbuildd.target.tests.test_lxd.TestLXD.test_start
----------------------------------------------------------------------
Traceback (most recent call last):
  File "lpbuildd/target/tests/test_lxd.py", line 376, in test_start
    MatchesListwise(expected_args))
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 435, in assertThat
    raise mismatch_error
testtools.matchers._impl.MismatchError: Differences: [
20 != 28: Length mismatch
!=:
reference = ['lxc',
 'exec',
 'lp-xenial-amd64',
 '--',
 'linux64',
 'mkdir',
 '-p',
 '/etc/systemd/system/snapd.service.d']
actual = ['lxc',
 'exec',
 'lp-xenial-amd64',
 '--',
 'linux64',
 'mknod',
 '-m',
 '0660',
 '/dev/dm-0',
 'b',
 '251',
 '0']

!=:
reference = ['lxc',
 'exec',
 'lp-xenial-amd64',
 '--',
 'linux64',
 'ln',
 '-s',
 '/dev/null',
 '/etc/systemd/system/snapd.refresh.timer']
actual = ['lxc',
 'exec',
 'lp-xenial-amd64',
 '--',
 'linux64',
 'mknod',
 '-m',
 '0660',
 '/dev/dm-1',
 'b',
 '251',
 '1']

]

review: Needs Fixing
Revision history for this message
Robert C Jennings (rcj) wrote :

Sorry cjwatson, will fix and mark ready for review again

Revision history for this message
Robert C Jennings (rcj) wrote :

Tests updated and now passing, ready for review again.

Revision history for this message
Colin Watson (cjwatson) :
Revision history for this message
Colin Watson (cjwatson) :
review: Approve
Revision history for this message
Robert C Jennings (rcj) wrote :

Shoot, sorry on the typo

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2019-11-06 11:12:41 +0000
3+++ debian/changelog 2019-11-21 17:03:19 +0000
4@@ -1,3 +1,9 @@
5+launchpad-buildd (181) UNRELEASED; urgency=medium
6+
7+ * LXD: Create dm-X devices to address kpartx hangs (LP: #1852518)
8+
9+ -- Robert C Jennings <robert.jennings@canonical.com> Wed, 13 Nov 2019 18:07:32 -0800
10+
11 launchpad-buildd (180) xenial; urgency=medium
12
13 * No-change release to work around production upgrade problem.
14
15=== modified file 'lpbuildd/target/lxd.py'
16--- lpbuildd/target/lxd.py 2019-06-09 07:49:21 +0000
17+++ lpbuildd/target/lxd.py 2019-11-21 17:03:19 +0000
18@@ -446,6 +446,13 @@
19 ["mknod", "-m", "0660", "/dev/loop%d" % minor,
20 "b", "7", str(minor)])
21
22+ # Create dm-# devices. On focal kpartx looks for dm devices and hangs
23+ # in their absense.
24+ for minor in range(8):
25+ self.run(
26+ ["mknod", "-m", "0660", "/dev/dm-%d" % minor,
27+ "b", "251", str(minor)])
28+
29 # XXX cjwatson 2017-09-07: With LXD < 2.2 we can't create the
30 # directory until the container has started. We can get away with
31 # this for the time being because snapd isn't in the buildd chroots.
32
33=== modified file 'lpbuildd/target/tests/test_lxd.py'
34--- lpbuildd/target/tests/test_lxd.py 2019-06-09 07:49:21 +0000
35+++ lpbuildd/target/tests/test_lxd.py 2019-11-21 17:03:19 +0000
36@@ -363,6 +363,12 @@
37 lxc +
38 ["mknod", "-m", "0660", "/dev/loop%d" % minor,
39 "b", "7", str(minor)]))
40+ for minor in range(8):
41+ expected_args.append(
42+ Equals(
43+ lxc +
44+ ["mknod", "-m", "0660", "/dev/dm-%d" % minor,
45+ "b", "251", str(minor)]))
46 expected_args.extend([
47 Equals(
48 lxc + ["mkdir", "-p", "/etc/systemd/system/snapd.service.d"]),

Subscribers

People subscribed via source and target branches