buildkit/util
Erik Sipsma 6ac4a81486 progress: fix sync issue in controller.
A panic was encountered where writes to progress status hit a nil
writer. While not easy to reproduce, this commit fixes a likely culprit.
The use of atomics in the controller was not safe against a race such as
the following:
1. One goroutine calls Start, incrementing count but not yet setting
   writer.
2. A second goroutine calls Start, increments count again but sees that
   count >1 and thus doesn't try to set writer.
3. The second goroutine then calls Status, assuming the writer has been
   set, but the first goroutine still hasn't set the writer yet, causing
   a nil pointer exception.

This commit fixes that issue by just using a mutex instead of atomics.
It also adds a nil check for the writer just to be safe against panics
due to unknown issues in the future as missing a status update is much
better than buildkitd crashing.

Signed-off-by: Erik Sipsma <erik@sipsma.dev>
2022-02-15 09:57:44 -08:00
..
apicaps hack: update linter to v1.43 2022-01-19 11:48:57 -08:00
appcontext go fmt: add //go:build 2021-10-28 13:26:43 +02:00
appdefaults go fmt: add //go:build 2021-10-28 13:26:43 +02:00
archutil archutil: amd64 variants support 2022-01-31 11:28:02 -08:00
bklog bklog: only log tracing ids when span exporter not nil 2021-09-09 09:32:39 +08:00
buildinfo buildinfo: check nil attrs 2022-02-14 22:55:37 +01:00
compression Do not re-tag non-distributable blob descriptors 2022-02-10 01:12:42 +00:00
cond util: add stateful cond package 2018-01-31 18:44:09 -08:00
contentutil resolver: set buildkit own user-agent 2022-02-05 19:40:50 -08:00
entitlements hack: enable more linters 2022-01-19 12:20:30 -08:00
flightcontrol util: remove outdated flightcontrol test assertion. 2021-08-16 17:26:36 +00:00
gitutil Move git protocol detection into seperate util 2021-03-31 12:42:57 -07:00
grpcerrors hack: enable more linters 2022-01-19 12:20:30 -08:00
imageutil imageutil: make mediatype detection more stricter 2021-11-17 15:44:18 -08:00
leaseutil leaseutil: mark temporary leases with timestamps 2019-10-16 10:35:50 -07:00
network go fmt: add //go:build 2021-10-28 13:26:43 +02:00
overlay hack: enable more linters 2022-01-19 12:20:30 -08:00
profiler profiler: add noshutdown hooks 2017-08-09 18:25:26 -07:00
progress progress: fix sync issue in controller. 2022-02-15 09:57:44 -08:00
pull Do not re-tag non-distributable blob descriptors 2022-02-10 01:12:42 +00:00
push push: always skip foreign layers 2022-02-11 00:59:53 +00:00
resolver authorizer: default token expiration to 60s 2022-02-13 21:51:15 -08:00
rootless/specconv go fmt: add //go:build 2021-10-28 13:26:43 +02:00
sshutil util/sshutil: minor linting / warning nits 2021-12-01 17:01:15 +01:00
stack util/stack: update protoc options to work with newer versions 2021-08-13 22:19:10 +02:00
suggest add error suggest pkg 2021-07-02 17:29:27 -07:00
system go fmt: add //go:build 2021-10-28 13:26:43 +02:00
testutil hack: enable more linters 2022-01-19 12:20:30 -08:00
throttle hack: enable more linters 2022-01-19 12:20:30 -08:00
tracing otel: update semconv 2022-01-28 10:19:00 +01:00
urlutil Refactor url redacting util 2021-09-14 17:39:07 +02:00
winlayers hack: enable more linters 2022-01-19 12:20:30 -08:00