uber / uber/tango

race in core/bazel

Open
#134 0 comments 0 reactions 1 assignee View on GitHub

@sywhang is already working on this.

Since Jun 30, 2026.

Dominant language
Go
Stars
14
Forks
7
Avg merge
3d 12h
Merged PRs (30d)
17

Description

There's a race in core/bazel w.r.t. stderr buffer streaming.

Running main test with -race repros this bug.

==================
WARNING: DATA RACE
Read at 0x00c0001e6270 by goroutine 22:
  bytes.(*Buffer).String()
      /opt/hostedtoolcache/go/1.24.5/x64/src/bytes/buffer.go:71 +0x124
  github.com/uber/tango/core/bazel.(*BazelClient).wrapQueryFailure()
      /home/runner/work/tango/tango/core/bazel/query.go:114 +0x100
  github.com/uber/tango/core/bazel.(*BazelClient).executeQueryInternal()
      /home/runner/work/tango/tango/core/bazel/query.go:98 +0xa67
  github.com/uber/tango/core/bazel.TestExecuteQueryInternal_ContextTimeout()
      /home/runner/work/tango/tango/core/bazel/query_test.go:171 +0xe64
  testing.tRunner()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:1792 +0x225
  testing.(*T).Run.gowrap1()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:1851 +0x44

Previous write at 0x00c0001e6270 by goroutine 27:
  bytes.(*Buffer).ReadFrom()
      /opt/hostedtoolcache/go/1.24.5/x64/src/bytes/buffer.go:216 +0x159
  io.copyBuffer()
      /opt/hostedtoolcache/go/1.24.5/x64/src/io/io.go:415 +0x21d
  io.Copy()
      /opt/hostedtoolcache/go/1.24.5/x64/src/io/io.go:388 +0x84
  github.com/uber/tango/core/bazel.streamOutput.func1()
      /home/runner/work/tango/tango/core/bazel/stream.go:29 +0x5a

Goroutine 22 (running) created at:
  testing.(*T).Run()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:1851 +0x8f2
  testing.runTests.func1()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:2279 +0x85
  testing.tRunner()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:1792 +0x225
  testing.runTests()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:2277 +0x96c
  testing.(*M).Run()
      /opt/hostedtoolcache/go/1.24.5/x64/src/testing/testing.go:2142 +0xeea
  main.main()
      _testmain.go:67 +0x164

Goroutine 27 (finished) created at:
  github.com/uber/tango/core/bazel.streamOutput()
      /home/runner/work/tango/tango/core/bazel/stream.go:28 +0x1c7
  github.com/uber/tango/core/bazel.(*BazelClient).executeQueryInternal.func2()
      /home/runner/work/tango/tango/core/bazel/query.go:93 +0xa4
  golang.org/x/sync/errgroup.(*Group).Go.func1()
      /home/runner/go/pkg/mod/golang.org/x/sync@v0.16.0/errgroup/errgroup.go:93 +0x91
==================

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.