Skip to content

Serialize log pauses - #4003

Draft
alexey-igrychev wants to merge 1 commit into
docker:masterfrom
alexey-igrychev:fix/serialize-log-pause
Draft

Serialize log pauses#4003
alexey-igrychev wants to merge 1 commit into
docker:masterfrom
alexey-igrychev:fix/serialize-log-pause

Conversation

@alexey-igrychev

Copy link
Copy Markdown

Concurrent Buildx progress printers call logutil.Pause against one global logrus logger. Pause read and replaced the logger output without serializing the pause intervals, which races under Go's race detector.

Serialize pauses until their buffered output is resumed, and cover concurrent calls with a race regression test.

Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
@alexey-igrychev

Copy link
Copy Markdown
Author

Verification:

  • CGO_ENABLED=1 go test -race ./util/logutil passes.
  • Mutation: removed the pause mutex → TestPauseConcurrent reports the logrus output race.
  • TESTPKGS=./util/logutil TESTFLAGS='-race -run TestPauseConcurrent' make test builds the test image but its test container sets CGO_ENABLED=0, so Go rejects -race.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant