Partition discovery is still running after calling producer.Close
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
- Create a producer for a partitioned topic
- Close the producer
- Delete the topic and its partition
System configuration
Pulsar version: v0.1.0