Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

server/embed: data-race about errHandler #19193

Closed
4 tasks done
fuweid opened this issue Jan 14, 2025 · 1 comment
Closed
4 tasks done

server/embed: data-race about errHandler #19193

fuweid opened this issue Jan 14, 2025 · 1 comment
Labels

Comments

@fuweid
Copy link
Member

fuweid commented Jan 14, 2025

Bug report criteria

What happened?

Saw one data-race issue in CI https://prow.k8s.io/view/gs/kubernetes-ci-logs/pr-logs/pull/etcd-io_etcd/19188/pull-etcd-integration-4-cpu-arm64/1879200899084062720

I think it's related to #19139. We should add wg.Add(1) before creating new goroutine.

{Failed  === RUN   TestEmbedEtcd
==================
WARNING: DATA RACE
Write at 0x00c0004ec768 by goroutine 124:
  runtime.racewrite()
      <autogenerated>:1 +0x10
  go.etcd.io/etcd/server/v3/embed.(*Etcd).Close()
      /home/prow/go/src/github.com/etcd-io/etcd/server/embed/etcd.go:460 +0x9a4
  go.etcd.io/etcd/tests/v3/integration/embed_test.TestEmbedEtcd()
      /home/prow/go/src/github.com/etcd-io/etcd/tests/integration/embed/embed_test.go:120 +0xf28
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x184
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1743 +0x40

Previous read at 0x00c0004ec768 by goroutine 223:
  runtime.raceread()
      <autogenerated>:1 +0x10
  go.etcd.io/etcd/server/v3/embed.(*Etcd).errHandler()
      /home/prow/go/src/github.com/etcd-io/etcd/server/embed/etcd.go:875 +0x48
  go.etcd.io/etcd/server/v3/embed.(*Etcd).servePeers.func3()
      /home/prow/go/src/github.com/etcd-io/etcd/server/embed/etcd.go:616 +0x148
  go.etcd.io/etcd/server/v3/embed.(*Etcd).servePeers.gowrap2()
      /home/prow/go/src/github.com/etcd-io/etcd/server/embed/etcd.go:617 +0x44

Goroutine 124 (running) created at:
  testing.(*T).Run()
      /usr/local/go/src/testing/testing.go:1743 +0x5e0
  testing.runTests.func1()
      /usr/local/go/src/testing/testing.go:2168 +0x80
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x184
  testing.runTests()
      /usr/local/go/src/testing/testing.go:2166 +0x6e0
  testing.(*M).Run()
      /usr/local/go/src/testing/testing.go:2034 +0xb74
  main.main()
      _testmain.go:53 +0x110

Goroutine 223 (finished) created at:
  go.etcd.io/etcd/server/v3/embed.(*Etcd).servePeers()
      /home/prow/go/src/github.com/etcd-io/etcd/server/embed/etcd.go:610 +0x70c
  go.etcd.io/etcd/server/v3/embed.StartEtcd()
      /home/prow/go/src/github.com/etcd-io/etcd/server/embed/etcd.go:274 +0x1bac
  go.etcd.io/etcd/tests/v3/integration/embed_test.TestEmbedEtcd()
      /home/prow/go/src/github.com/etcd-io/etcd/tests/integration/embed/embed_test.go:97 +0xb3c
  testing.tRunner()
      /usr/local/go/src/testing/testing.go:1690 +0x184
  testing.(*T).Run.gowrap1()
      /usr/local/go/src/testing/testing.go:1743 +0x40
==================
    testing.go:1399: race detected during execution of test
--- FAIL: TestEmbedEtcd (1.49s)
}

What did you expect to happen?

No data race

How can we reproduce it (as minimally and precisely as possible)?

good luck

$ cd tests/integration/embed
$ go test -v -race '-run=^TestEmbedEtcd$' -failfast -count=100 ./

Anything else we need to know?

No response

Etcd version (please run commands below)

$ etcd --version
# paste output here

$ etcdctl version
# paste output here

Etcd configuration (command line flags or environment variables)

paste your configuration here

Etcd debug information (please run commands below, feel free to obfuscate the IP address or FQDN in the output)

$ etcdctl member list -w table
# paste output here

$ etcdctl --endpoints=<member list> endpoint status -w table
# paste output here

Relevant log output

@fuweid
Copy link
Member Author

fuweid commented Jan 14, 2025

cc @joshuazh-x

@fuweid fuweid closed this as completed Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant