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 found in the async producer #2673

Closed
3AceShowHand opened this issue Oct 16, 2023 · 0 comments · Fixed by #2678
Closed

data race found in the async producer #2673

3AceShowHand opened this issue Oct 16, 2023 · 0 comments · Fixed by #2678

Comments

@3AceShowHand
Copy link

Description
Versions
Sarama Kafka Go
v1.41.2 1.21.2
Configuration
Logs
logs: CLICK ME


==================
WARNING: DATA RACE
Read at 0x00c003b01470 by goroutine 2265:
  github.com/IBM/sarama.(*Broker).AsyncProduce()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/broker.go:437 +0x5d
  github.com/IBM/sarama.(*asyncProducer).newBrokerProducer.func1()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:829 +0x264
  github.com/IBM/sarama.withRecover()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/utils.go:43 +0x41
  github.com/IBM/sarama.(*asyncProducer).newBrokerProducer.func4()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:794 +0x33

Previous write at 0x00c003b01470 by goroutine 2262:
  github.com/IBM/sarama.(*Broker).Open()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/broker.go:181 +0x3d2
  github.com/IBM/sarama.(*client).cachedLeader()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/client.go:891 +0x2cf
  github.com/IBM/sarama.(*client).LeaderAndEpoch()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/client.go:501 +0x64
  github.com/IBM/sarama.(*client).Leader()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/client.go:492 +0x44
  github.com/IBM/sarama.(*nopCloserClient).Leader()
      <autogenerated>:1 +0x6a
  github.com/IBM/sarama.(*partitionProducer).dispatch()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:632 +0xe7
  github.com/IBM/sarama.(*partitionProducer).dispatch-fm()
      <autogenerated>:1 +0x33
  github.com/IBM/sarama.withRecover()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/utils.go:43 +0x41
  github.com/IBM/sarama.(*asyncProducer).newPartitionProducer.func1()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:600 +0x33

Goroutine 2265 (running) created at:
  github.com/IBM/sarama.(*asyncProducer).newBrokerProducer()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:794 +0x690
  github.com/IBM/sarama.(*asyncProducer).getBrokerProducer()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:1343 +0x11d
  github.com/IBM/sarama.(*partitionProducer).dispatch()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:634 +0x1a9
  github.com/IBM/sarama.(*partitionProducer).dispatch-fm()
      <autogenerated>:1 +0x33
  github.com/IBM/sarama.withRecover()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/utils.go:43 +0x41
  github.com/IBM/sarama.(*asyncProducer).newPartitionProducer.func1()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:600 +0x33

Goroutine 2262 (running) created at:
  github.com/IBM/sarama.(*asyncProducer).newPartitionProducer()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:600 +0x410
  github.com/IBM/sarama.(*topicProducer).dispatch()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:510 +0x1ba
  github.com/IBM/sarama.(*topicProducer).dispatch-fm()
      <autogenerated>:1 +0x33
  github.com/IBM/sarama.withRecover()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/utils.go:43 +0x41
  github.com/IBM/sarama.(*asyncProducer).newTopicProducer.func1()
      /go/pkg/mod/github.com/!i!b!m/[email protected]/async_producer.go:495 +0x33
==================

Additional Context
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

Successfully merging a pull request may close this issue.

1 participant