RobertIndie commented on code in PR #1437:
URL: https://github.com/apache/pulsar-client-go/pull/1437#discussion_r2536218630
##########
pulsar/producer_impl.go:
##########
@@ -319,12 +315,26 @@ func (p *producer) getPartition(msg *ProducerMessage)
Producer {
return producers[partition]
}
+func (p *producer) getProducers() []Producer {
+ if producers := p.producers.Load(); producers != nil {
+ return producers.([]Producer)
+ }
+ return []Producer{}
Review Comment:
Yes. Add a panic check in the `getProducer(partition)`.
This method is also used at
https://github.com/apache/pulsar-client-go/blob/7940ff88dd91b2af3b721b0e4c0cf4910bafdc53/pulsar/producer_impl.go#L194
so it's expected to return the empty producers slice during the init.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]