mirror of
https://github.com/moby/buildkit.git
synced 2026-11-06 05:16:45 +00:00
sender.Finalize read pw.req.Canceled without pw.mu while the scheduler goroutine could update the request through receiver.Cancel -> setRequest at the same time. This happened when the request function returned a cancellation error of its own while the receiver cancelled. Use the locked Request() accessor. Add a test that cancels concurrently with a function returning context.Canceled; it reports the race under -race without the fix. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>