From cac0b68f9e79907407f709aeeef5e8dbe230293d Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Sun, 25 Oct 2020 21:46:19 -0700 Subject: [PATCH] solver: make sure job id cleared after build Signed-off-by: Tonis Tiigi --- solver/jobs.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solver/jobs.go b/solver/jobs.go index 9698797ce487..84b300591323 100644 --- a/solver/jobs.go +++ b/solver/jobs.go @@ -230,6 +230,7 @@ type Job struct { pw progress.Writer span opentracing.Span values sync.Map + id string progressCloser func() SessionID string @@ -429,6 +430,7 @@ func (jl *Solver) NewJob(id string) (*Job, error) { pw: pw, progressCloser: progressCloser, span: (&opentracing.NoopTracer{}).StartSpan(""), + id: id, } jl.jobs[id] = j @@ -513,6 +515,8 @@ func (j *Job) Discard() error { } st.mu.Unlock() } + + delete(j.list.jobs, j.id) return nil }