Skip to content

Commit

Permalink
Merge pull request #1561 from tjkirch/extinct-record
Browse files Browse the repository at this point in the history
buildsys: retry package build after known BuildKit internal error
  • Loading branch information
tjkirch authored May 5, 2021
2 parents f93f9fe + b99490c commit 74099a5
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion tools/buildsys/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@ lazy_static! {
.unwrap();
}

/*
There's a similar bug that's fixed in new releases of BuildKit but still in the wild in popular
versions of Docker/BuildKit:
https://github.com/moby/buildkit/issues/1468
*/
lazy_static! {
static ref DOCKER_BUILD_DEAD_RECORD_ERROR: Regex = Regex::new(concat!(
r#"failed to solve with frontend dockerfile.v0: "#,
r#"failed to solve with frontend gateway.v0: "#,
r#"rpc error: code = Unknown desc = failed to build LLB: "#,
r#"failed to get dead record"#,
))
.unwrap();
}

/*
We also see sporadic CI failures with only this error message.
We use (?m) for multi-line mode so we can match the message on a line of its own without splitting
Expand Down Expand Up @@ -229,7 +244,11 @@ fn build(
&build,
Retry::Yes {
attempts: DOCKER_BUILD_MAX_ATTEMPTS,
messages: &[&*DOCKER_BUILD_FRONTEND_ERROR, &*UNEXPECTED_EOF_ERROR],
messages: &[
&*DOCKER_BUILD_FRONTEND_ERROR,
&*DOCKER_BUILD_DEAD_RECORD_ERROR,
&*UNEXPECTED_EOF_ERROR,
],
},
)?;

Expand Down

0 comments on commit 74099a5

Please sign in to comment.