Skip to content

Commit 4786f7b

Browse files
Add comment, update from review
Signed-off-by: Jacob Gillespie <[email protected]>
1 parent 4e8b42e commit 4786f7b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

solver/jobs.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,11 +343,10 @@ func (jl *Solver) loadUnlocked(v, parent Vertex, j *Job, cache map[Vertex]Vertex
343343
st, ok := jl.actives[dgstWithoutCache]
344344

345345
if ok {
346-
v = &vertexWithCacheOptions{
347-
Vertex: v,
348-
dgst: dgstWithoutCache,
349-
inputs: inputs,
350-
}
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
351350
}
352351

353352
if !ok {

0 commit comments

Comments
 (0)