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

DATA RACE in invokeAckHandler #261

Open
spikeekips opened this issue Mar 22, 2022 · 0 comments
Open

DATA RACE in invokeAckHandler #261

spikeekips opened this issue Mar 22, 2022 · 0 comments

Comments

@spikeekips
Copy link

I implemented my own memberlist Transport for quic and I met data race like below.

==================
WARNING: DATA RACE
Read at 0x00c00000e370 by goroutine 19:
  github.com/hashicorp/memberlist.(*Memberlist).invokeAckHandler()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:874 +0x137
  github.com/hashicorp/memberlist.(*Memberlist).handleAck()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:669 +0x267
  github.com/hashicorp/memberlist.(*Memberlist).handleCommand()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:439 +0x1a4
  github.com/hashicorp/memberlist.(*Memberlist).ingestPacket()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:414 +0x8d8
  github.com/hashicorp/memberlist.(*Memberlist).packetListen()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:352 +0xe9
  github.com/hashicorp/memberlist.newMemberlist·dwrap·5()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:228 +0x39

Previous write at 0x00c00000e370 by goroutine 24:
  github.com/hashicorp/memberlist.(*Memberlist).setProbeChannels()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:835 +0x353
  github.com/hashicorp/memberlist.(*Memberlist).probeNode()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:310 +0x628
  github.com/hashicorp/memberlist.(*Memberlist).probe()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:255 +0x364
  github.com/hashicorp/memberlist.(*Memberlist).probe-fm()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:214 +0x39
  github.com/hashicorp/memberlist.(*Memberlist).triggerFunc()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:157 +0x156
  github.com/hashicorp/memberlist.(*Memberlist).schedule·dwrap·38()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:121 +0x71

Goroutine 19 (running) created at:
  github.com/hashicorp/memberlist.newMemberlist()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:228 +0x146a
  github.com/hashicorp/memberlist.Create()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:239 +0x30
  quicstream/discovery.NewServer()
      quicstream/discovery/server.go:26 +0x4a
  main.main()
      quicstream/cmd/discovery.go:135 +0xc5c

Goroutine 24 (running) created at:
  github.com/hashicorp/memberlist.(*Memberlist).schedule()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:121 +0x3f4
  github.com/hashicorp/memberlist.Create()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:247 +0x84
  quicstream/discovery.NewServer()
      quicstream/discovery/server.go:26 +0x4a
  main.main()
      quicstream/cmd/discovery.go:135 +0xc5c
==================
==================
WARNING: DATA RACE
Read at 0x00c0005942a0 by goroutine 19:
  time.(*Timer).Stop()
      /home/spikeekips/.gvm/gos/go1.17.7/src/time/sleep.go:78 +0x150
  github.com/hashicorp/memberlist.(*Memberlist).invokeAckHandler()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:874 +0x128
  github.com/hashicorp/memberlist.(*Memberlist).handleAck()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:669 +0x267
  github.com/hashicorp/memberlist.(*Memberlist).handleCommand()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:439 +0x1a4
  github.com/hashicorp/memberlist.(*Memberlist).ingestPacket()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:414 +0x8d8
  github.com/hashicorp/memberlist.(*Memberlist).packetListen()
      .pkg/mod/github.com/hashicorp/[email protected]/net.go:352 +0xe9
  github.com/hashicorp/memberlist.newMemberlist·dwrap·5()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:228 +0x39

Previous write at 0x00c0005942a0 by goroutine 24:
  time.AfterFunc()
      /home/spikeekips/.gvm/gos/go1.17.7/src/time/sleep.go:168 +0x55
  github.com/hashicorp/memberlist.(*Memberlist).setProbeChannels()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:835 +0x344
  github.com/hashicorp/memberlist.(*Memberlist).probeNode()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:310 +0x628
  github.com/hashicorp/memberlist.(*Memberlist).probe()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:255 +0x364
  github.com/hashicorp/memberlist.(*Memberlist).probe-fm()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:214 +0x39
  github.com/hashicorp/memberlist.(*Memberlist).triggerFunc()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:157 +0x156
  github.com/hashicorp/memberlist.(*Memberlist).schedule·dwrap·38()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:121 +0x71

Goroutine 19 (running) created at:
  github.com/hashicorp/memberlist.newMemberlist()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:228 +0x146a
  github.com/hashicorp/memberlist.Create()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:239 +0x30
  quicstream/discovery.NewServer()
      quicstream/discovery/server.go:26 +0x4a
  main.main()
      quicstream/cmd/discovery.go:135 +0xc5c

Goroutine 24 (running) created at:
  github.com/hashicorp/memberlist.(*Memberlist).schedule()
      .pkg/mod/github.com/hashicorp/[email protected]/state.go:121 +0x3f4
  github.com/hashicorp/memberlist.Create()
      .pkg/mod/github.com/hashicorp/[email protected]/memberlist.go:247 +0x84
  quicstream/discovery.NewServer()
      quicstream/discovery/server.go:26 +0x4a
  main.main()
      quicstream/cmd/discovery.go:135 +0xc5c
==================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant