Skip to content

Commit

Permalink
Fix occasional proc unmount failures
Browse files Browse the repository at this point in the history
With certain applications, we have seen cases where proc failed to
unmount properly, reporting a busy target. This change makes sure to
unmount proc after all other mount points, which appears to fix the
issue.
  • Loading branch information
d-e-s-o committed Feb 19, 2024
1 parent 99d5035 commit 0b9f2ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Unreleased
----------
- Remove all package file extensions when inferring deploy directory
name
- Fixed occasional `proc` unmount failures


0.1.0
Expand Down
11 changes: 9 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,15 @@ async fn cleanup_chroot(chroot: &Path, remove: bool) -> Result<()> {
],
);

let results = <[_; 6]>::from(join!(proc, dev, sys, repos, tmp, run));
let () = results.into_iter().try_for_each(|result| result)?;
let results = join!(dev, sys, repos, tmp, run);
// There exists some kind of a dependency causing the `proc` unmount
// to occasionally fail when run in parallel to the others. So make
// sure to run it strictly afterwards.
let result = proc.await;
let () = <[_; 5]>::from(results)
.into_iter()
.chain([result])
.try_for_each(|result| result)?;

if remove {
let () = remove_dir_all(chroot).await?;
Expand Down

0 comments on commit 0b9f2ab

Please sign in to comment.