~snappy-dev/snapd/+git/snapd-pawel:startup-timings

Last commit made on 2019-06-04
Get this branch:
git clone -b startup-timings https://git.launchpad.net/~snappy-dev/snapd/+git/snapd-pawel

Branch merges

Branch information

Name:
startup-timings
Repository:
lp:~snappy-dev/snapd/+git/snapd-pawel

Recent commits

d3a1b8a... by Paweł Stołowski

Provide more helpful error if no arguments are given.

af797ce... by Paweł Stołowski

Check conflicting flags. Use choices for --ensure=.. and --startup=.. flags.

f1139c2... by Paweł Stołowski

Merge branch 'master' into startup-timings

0b59ceb... by Michael Vogt

Merge pull request #6938 from sergiocazzolato/add-opnensuse-leap-15-1

tests: run spread tests on opensuse leap 15.1

00fdbaf... by Zygmunt Krynicki

Merge pull request #6941 from bboozzoo/bboozzoo/strutil-fix-ineffassign

strutil/shlex: fix ineffassign

8d883ae... by Maciej Borzecki

strutil/shlex: fix ineffassign

The `state` variable is function local, assigning before return does not make
sense.

Fixes:
github.com/snapcore/snapd/strutil/shlex/shlex.go:375:8: ineffectual assignment to state

Signed-off-by: Maciej Borzecki <email address hidden>

7e54e41... by Sergio Cazzolato

Removing packaging for old opensuse versions

1b88be6... by Sergio Cazzolato

Run spread tests on opensuse leap 15.1

This change includes:
. Run tests on new opensuse leap 15.1 image
. Move to manual opensuse leap 15.0
. Remove opensuse 42.3

8999873... by "John R. Lenton" <email address hidden>

Merge pull request #6933 from mvo5/min-gomaxprocs-2

cmd/snapd: ensure GOMAXPROCS is at least 2

eff8bd5... by Zygmunt Krynicki

cmd/snap-update-ns: detach unused mount points (#6937)

* cmd/snap-update-ns: detach unused mount points

When snap-update-ns determines that a mount point is no longer needed
and should be unmounted it really tried to unmount things. This was
working because usually there were no nested mount structures present.

We were alerted that a particular layout would fail to refresh. The
layout in question is simply:

    layout:
      $SNAP/bar/mount:
 bind: $SNAP/foo
      $SNAP/baz:
 bind: $SNAP/bar

That is:
 - $SNAP/bar/mount is a view into $SNAP/foo
 - $SNAP/baz is a view into $SNAP/bar
    (which contains a view into SNAP/foo)

Since layout elements use $SNAP, which contains the revision number,
each time such layout is refreshed it will really be re-created as the
old paths will no longer be used. This will create a situation where
the mount point $SNAP/baz cannot be unmounted because there's
$SNAP/baz/mount is a mount point. This can be seen by looking at the
output of snap-update-ns debug log:

    desired mount profile:
     /snap/layout-content-test/x2/foo /snap/layout-content-test/x2/bar/mount none rbind,rw,x-snapd.origin=layout 0 0
     /snap/layout-content-test/x2/bar /snap/layout-content-test/x2/baz none rbind,rw,x-snapd.origin=layout 0 0
    current mount profile (before applying changes):
     /snap/layout-content-test/x1/foo /snap/layout-content-test/x1/bar/mount none rbind,rw,x-snapd.origin=layout 0 0
     /snap/layout-content-test/x1/bar /snap/layout-content-test/x1/baz none rbind,rw,x-snapd.origin=layout 0 0
    desiredIDs: map[/snap/layout-content-test/x2/bar/mount:true /snap/layout-content-test/x2/baz:true]
    reuse: map[]
    mount changes needed:
     unmount (/snap/layout-content-test/x1/bar /snap/layout-content-test/x1/baz none rbind,rw,x-snapd.origin=layout 0 0)
     unmount (/snap/layout-content-test/x1/foo /snap/layout-content-test/x1/bar/mount none rbind,rw,x-snapd.origin=layout 0 0)
     mount (/snap/layout-content-test/x2/foo /snap/layout-content-test/x2/bar/mount none rbind,rw,x-snapd.origin=layout 0 0)
     mount (/snap/layout-content-test/x2/bar /snap/layout-content-test/x2/baz none rbind,rw,x-snapd.origin=layout 0 0)
    performing mount changes:
      * unmount (/snap/layout-content-test/x1/bar /snap/layout-content-test/x1/baz none rbind,rw,x-snapd.origin=layout 0 0)
    umount "/snap/layout-content-test/x1/baz" (error: device or resource busy)

This is obviously something where we should have used MNT_DETACH, since
that will have the kernel handle the inner elements ahead of the outer
elements.

In fact, we should never really unmount anything as running applications
may hold open file descriptors and that would cause the mount namespace
update to fail miserably with partially-applied content changes. To
avoid this problem, whenever a mount entry, that doesn't represent a
symlink, is no longer needed it is simply detached, rather than
unmounted.

Fixes: https://bugs.launchpad.net/snapd/+bug/1831010
Signed-off-by: Zygmunt Krynicki <email address hidden>