mirror of
https://github.com/moby/buildkit.git
synced 2026-06-24 08:47:57 +00:00
When noCache=true, Platforms() appends to w.WorkerOpt.Platforms. Concurrent gRPC calls to ListWorkers (each handled in a separate goroutine) can cause a data race where one goroutine creates matchers with length N, while another appends new platforms, causing the first goroutine's range to exceed matchers bounds: panic: runtime error: index out of range [81] with length 81 Add sync.Mutex to serialize access to Platforms(). Signed-off-by: okhowang(王沛文) <okhowang@tencent.com>