Skip to content

Fix buildlogger write race

Arran Walker requested to merge ajwalker/buildlogger-write-race into main

What does this MR do?

Puts a mutex writer in front of buildlogger transforming writers.

Why was this MR needed?

The transforming writers do not provide locking, as this was intended to be a higher level concern, but this was missed when moving to buildlogger.

This provides a mutex writer that fields the transformers from concurrent writes.

What's the best way to test this MR?

We have existing tests that were picking this up, but not consistently (as is often the case with races).

Running this locally should yield the problem:

go test -run Test_CaptureServiceLogs -v ./executors/docker -tags integration -race -count 10

What are the relevant issue numbers?

Merge request reports