Skip to content

Commit

Permalink
[antlir2][btrfs package] increase loop retries
Browse files Browse the repository at this point in the history
Summary:
metalos ci builds tons of loopbacks and fails constantly on diffs, try to bump
up retries

Test Plan: testhard

Reviewed By: wujj123456

Differential Revision: D49980561

fbshipit-source-id: 350f8eeafe0f00845dcd367cfcacaf445d4d3bf4
  • Loading branch information
vmagro authored and facebook-github-bot committed Oct 6, 2023
1 parent b2e8870 commit df1c9ef
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions antlir/antlir2/antlir2_packager/btrfs_packager/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,17 @@ impl LdHandle {
// supposed to be atomic, but we're clearly getting what looks like race
// conditions on CI, so just retry a few times and hopefully we'll get a
// good device before giving up
retry::retry(retry::delay::Fixed::from_millis(50).take(3), || {
let ld = lc
.next_free()
.context("Failed to find a free loopback device")?;
Self::attach(ld, target.clone())
})
retry::retry(
retry::delay::Fixed::from_millis(100)
.map(retry::delay::jitter)
.take(10),
|| {
let ld = lc
.next_free()
.context("Failed to find a free loopback device")?;
Self::attach(ld, target.clone())
},
)
.map_err(|e| match e {
retry::Error::Operation { error, .. } => error,
retry::Error::Internal(s) => anyhow::Error::msg(s),
Expand Down

0 comments on commit df1c9ef

Please sign in to comment.