pulsar-client-go icon indicating copy to clipboard operation
pulsar-client-go copied to clipboard

Partition discovery is still running after calling producer.Close

Open dvergnes opened this issue 6 years ago • 0 comments

Expected behavior

Once a producer is closed, the ticker running the partitions discovery in the background should stop.

Actual behavior

The ticker is still running in the background and there is a race condition when the number of partitions changes after the producer is closed. panic: runtime error: index out of range [1] with length 1 goroutine 370 [running]: /go/src/my-project/vendor/github.com/apache/pulsar-client-go/pulsar.(*producer).internalCreatePartitionsProducers(0xc000527680, 0x0, 0x0) /go/src/my-project/vendor/github.com/apache/pulsar-client-go/pulsar/producer_impl.go:136 +0x859 /go/src/my-project/vendor/github.com/apache/pulsar-client-go/pulsar.newProducer.func2(0xc000527680) /go/src/my-project/vendor/github.com/apache/pulsar-client-go/pulsar/producer_impl.go:100 +0xb7 created by my-project/vendor/github.com/apache/pulsar-client-go/pulsar.newProducer /go/src/my-project/vendor/github.com/apache/pulsar-client-go/pulsar/producer_impl.go:97 +0x171

Steps to reproduce

  1. Create a producer for a partitioned topic
  2. Close the producer
  3. Delete the topic and its partition

System configuration

Pulsar version: v0.1.0

dvergnes avatar Jun 09 '20 02:06 dvergnes