mirror of
https://github.com/moby/buildkit.git
synced 2026-10-28 16:44:37 +08:00
GetResolvConf read and wrote the package-level notFirstRun and lastNotEmpty flags inside its flightcontrol callback. flightcontrol only serializes calls with the same key, so calls for different roots, or for resolv.conf and resolv-host.conf at once, raced on them. Make both flags atomic.Bool; the sequential behavior is unchanged. Add a test that generates resolv.conf for several roots concurrently; it reports the race under -race without the fix. Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>