You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bit of a brain dump - while exploring another related scheduler bug (attempting to investigate #3635), I managed to construct an interesting (and very reproducible!) test case that could potentially occur:
// scheduler_test.gofuncTestParallelCancel(t*testing.T) {
t.Parallel()
// this is quite rare 😥fori:=0; i<10000; i++ {
ctx:=context.TODO()
cacheManager:=newTrackingCacheManager(NewInMemoryCacheManager())
l:=NewSolver(SolverOpt{
ResolveOpFunc: testOpResolver,
DefaultCache: cacheManager,
})
deferl.Close()
j0, err:=l.NewJob("j0")
require.NoError(t, err)
j1, err:=l.NewJob("j1")
require.NoError(t, err)
g:=Edge{
Vertex: vtxSum(1, vtxOpt{
inputs: []Edge{
{Vertex: vtxConst(3, vtxOpt{})},
{Vertex: vtxConst(2, vtxOpt{})},
},
}),
}
canceledCtx, cancel:=context.WithCancel(ctx)
cancel()
eg:= errgroup.Group{}
eg.Go(func() error {
// a normal build_, err:=j0.Build(ctx, g)
returnerr
})
eg.Go(func() error {
// a build that is launched, and then pretty immediately cancelled// NOTE: the failure only occurs if they are run in parallel! in serial, these succeed!_, err:=j1.Build(canceledCtx, g)
iferr!=nil&&err!=context.Canceled {
returnerr
}
returnnil
})
require.NoError(t, eg.Wait())
}
}
This fails with:
$ go test -run "TestParallelCancel$" -v
=== RUN TestParallelCancel
=== PAUSE TestParallelCancel
=== CONT TestParallelCancel
scheduler_test.go:3259:
Error Trace: /home/jedevc/Documents/Projects/moby/buildkit/solver/scheduler_test.go:3259
Error: Received unexpected error:
buildkit scheduler error: return leaving outgoing open. Please report this with BUILDKIT_SCHEDULER_DEBUG=1
github.com/moby/buildkit/solver.(*scheduler).dispatch
/home/jedevc/Documents/Projects/moby/buildkit/solver/scheduler.go:214
github.com/moby/buildkit/solver.(*scheduler).loop
/home/jedevc/Documents/Projects/moby/buildkit/solver/scheduler.go:118
runtime.goexit
/usr/lib/go/src/runtime/asm_amd64.s:1695
Test: TestParallelCancel
--- FAIL: TestParallelCancel (1.12s)
FAIL
exit status 1
FAIL github.com/moby/buildkit/solver 1.126s
Maybe a bit of an edge case? But also this does seem to reproduce fairly consistently, and could potentially be another nastier issue.
The text was updated successfully, but these errors were encountered:
Bit of a brain dump - while exploring another related scheduler bug (attempting to investigate #3635), I managed to construct an interesting (and very reproducible!) test case that could potentially occur:
This fails with:
Maybe a bit of an edge case? But also this does seem to reproduce fairly consistently, and could potentially be another nastier issue.
The text was updated successfully, but these errors were encountered: