Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context: on error use lazy umount #26

Merged
merged 1 commit into from Jan 31, 2023
Merged

context: on error use lazy umount #26

merged 1 commit into from Jan 31, 2023

Conversation

xypron
Copy link
Contributor

@xypron xypron commented Jan 17, 2023

Closes: #25

When running kernel-replace 'umount -R' tends to fail. Catch the exception and use 'umount -l' in that case.

Signed-off-by: Heinrich Schuchardt xypron.glpk@gmx.de

Closes: mwhudson#25

When running kernel-replace 'umount -R' tends to fail.
Catch the exception and use 'umount -l' in that case.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
@mwhudson
Copy link
Owner

While this is probably a pragmatic change, I do really hate the sort of non-deterministic approach to cleaning up mounts. Do you have any idea why the umount -R is failing?

@xypron
Copy link
Contributor Author

xypron commented Jan 19, 2023

@mwhudson I was not able to identify the process that is blocking the release. Are you able to reproduce the problem?

@mwhudson
Copy link
Owner

I spent a while (probably too long) trying to figure out what's going on and failing which is a bit annoying. Oh well. This is a pragmatic change.

@mwhudson mwhudson merged commit 045ec74 into mwhudson:main Jan 31, 2023
mvo5 added a commit to mvo5/snappy that referenced this pull request Jul 3, 2023
The existing code in writeFilesystemContent() will error when
the filesystem cannot be unmounted. However in practise this
is problematic as the live-system can keep the mount point
busy: https://bugs.launchpad.net/snapd/+bug/2025402

As a pragmatic solution this commit unmounts the filesystem
with the `--lazy` option if a normal unmount does not work.

This is what live-editor is doing:
mwhudson/livefs-editor#26

Alternatively we could do a bunch of retries and wait for
the process that keep the filesystem busy to go away.
mvo5 added a commit to snapcore/snapd that referenced this pull request Jul 4, 2023
* install: lazy unmount() in writeFilesystemContent() if needed

The existing code in writeFilesystemContent() will error when
the filesystem cannot be unmounted. However in practise this
is problematic as the live-system can keep the mount point
busy: https://bugs.launchpad.net/snapd/+bug/2025402

As a pragmatic solution this commit unmounts the filesystem
with the `--lazy` option if a normal unmount does not work.

This is what live-editor is doing:
mwhudson/livefs-editor#26

Alternatively we could do a bunch of retries and wait for
the process that keep the filesystem busy to go away.

* install: log unmount errors (thanks to Alfonso!)

* install: also lazy unmount in MountVolumes()

* install: fix silly typo

* install: improve logging on install failure
mvo5 added a commit to snapcore/snapd that referenced this pull request Jul 4, 2023
* install: lazy unmount() in writeFilesystemContent() if needed

The existing code in writeFilesystemContent() will error when
the filesystem cannot be unmounted. However in practise this
is problematic as the live-system can keep the mount point
busy: https://bugs.launchpad.net/snapd/+bug/2025402

As a pragmatic solution this commit unmounts the filesystem
with the `--lazy` option if a normal unmount does not work.

This is what live-editor is doing:
mwhudson/livefs-editor#26

Alternatively we could do a bunch of retries and wait for
the process that keep the filesystem busy to go away.

* install: log unmount errors (thanks to Alfonso!)

* install: also lazy unmount in MountVolumes()

* install: fix silly typo

* install: improve logging on install failure
mvo5 added a commit to snapcore/snapd that referenced this pull request Jul 4, 2023
* install: lazy unmount() in writeFilesystemContent() if needed

The existing code in writeFilesystemContent() will error when
the filesystem cannot be unmounted. However in practise this
is problematic as the live-system can keep the mount point
busy: https://bugs.launchpad.net/snapd/+bug/2025402

As a pragmatic solution this commit unmounts the filesystem
with the `--lazy` option if a normal unmount does not work.

This is what live-editor is doing:
mwhudson/livefs-editor#26

Alternatively we could do a bunch of retries and wait for
the process that keep the filesystem busy to go away.

* install: log unmount errors (thanks to Alfonso!)

* install: also lazy unmount in MountVolumes()

* install: fix silly typo

* install: improve logging on install failure
@xypron xypron deleted the umount branch July 14, 2023 09:11
alexmurray pushed a commit to alexmurray/snapd that referenced this pull request Oct 17, 2023
…re#12939)

* install: lazy unmount() in writeFilesystemContent() if needed

The existing code in writeFilesystemContent() will error when
the filesystem cannot be unmounted. However in practise this
is problematic as the live-system can keep the mount point
busy: https://bugs.launchpad.net/snapd/+bug/2025402

As a pragmatic solution this commit unmounts the filesystem
with the `--lazy` option if a normal unmount does not work.

This is what live-editor is doing:
mwhudson/livefs-editor#26

Alternatively we could do a bunch of retries and wait for
the process that keep the filesystem busy to go away.

* install: log unmount errors (thanks to Alfonso!)

* install: also lazy unmount in MountVolumes()

* install: fix silly typo

* install: improve logging on install failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

replace-kernel: unmounting fails
2 participants