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.
This commit is contained in:
Christian Kellner 2021-07-07 12:43:32 +00:00 committed by Tom Gundersen
parent 1dc845f331
commit 23628b3f62

View file

@ -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)