Skip to content

Commit a27d16c

Browse files
authored
Merge pull request moby#3953 from jacobwgillespie/load-unlocked-bug
Fix issue with digest merge (inconsistent graph state)
2 parents cb86cc6 + 4786f7b commit a27d16c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

solver/jobs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,13 @@ func (jl *Solver) loadUnlocked(v, parent Vertex, j *Job, cache map[Vertex]Vertex
342342
// if same vertex is already loaded without cache just use that
343343
st, ok := jl.actives[dgstWithoutCache]
344344

345+
if ok {
346+
// When matching an existing active vertext by dgstWithoutCache, set v to the
347+
// existing active vertex, as otherwise the original vertex will use an
348+
// incorrect digest and can incorrectly delete it while it is still in use.
349+
v = st.vtx
350+
}
351+
345352
if !ok {
346353
st, ok = jl.actives[dgst]
347354

0 commit comments

Comments
 (0)