sunby opened a new issue #733: URL: https://github.com/apache/pulsar-client-go/issues/733
#### Expected behavior Producer reconnect to broker after server restart. #### Actual behavior In the current code, I find that if a connection is closed, it will try to stop all producer listeners and consumer handlers registered on it. But if the producer has set the connection to `conn` and does not register the listener to this connection in https://github.com/apache/pulsar-client-go/blob/1df5596aa7a351c6f43edb53f54b2a14b83b0073/pulsar/producer_partition.go#L264-L265. And the connection is closed by another goroutine because of `connection.handleSendError` https://github.com/apache/pulsar-client-go/blob/1df5596aa7a351c6f43edb53f54b2a14b83b0073/pulsar/internal/connection.go#L793. The producer can not do `reconnectToBroker` because no signal will sent to `connectClosedCh`. Maybe we should check the result of `RegisterListener` and call `ConnectionClosed` by manually? #### Steps to reproduce It's not stable to reproduce #### System configuration **Pulsar version**: x.y -- 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]
