From 23628b3f627b3bcbba8d143bc8c5e2b7134e2b9c Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Wed, 7 Jul 2021 12:43:32 +0000 Subject: [PATCH] objectstore: sync before unmounting This should, in theory, not be necessary because the bubblewrap process and its children should be stopped already and umount should just block until it is finished. But, if the store is on a filesystem, like the one used by docker machine, unmounting frequently produces errors like: `umount: .../tmp9nlyzwdu-writer: target is busy.` Syncing the filesystem before that seems to help in some cases and it surely does not hurt. --- osbuild/objectstore.py | 1 + 1 file changed, 1 insertion(+) diff --git a/osbuild/objectstore.py b/osbuild/objectstore.py index 2aad57b5..8fd8cf82 100644 --- a/osbuild/objectstore.py +++ b/osbuild/objectstore.py @@ -48,6 +48,7 @@ def umount(target, lazy=False): args = [] if lazy: args += ["--lazy"] + subprocess.run(["sync", "-f", target], check=True) subprocess.run(["umount"] + args + [target], check=True)