wolfstudy commented on a change in pull request #703:
URL: https://github.com/apache/pulsar-client-go/pull/703#discussion_r782679888
##########
File path: pulsar/internal/connection.go
##########
@@ -163,6 +163,9 @@ type connection struct {
consumerHandlersLock sync.RWMutex
consumerHandlers map[uint64]ConsumerHandler
+ reconnectFlagLock sync.Mutex
+ reconnectFlag bool
Review comment:
The calling path of the entire code is:
1. The broker notifies the client to close the connection and sends
CommandCloseProducer or CommandCloseConsumer cmd to the client
2. The client receives this command and starts to enter the logic of
handleCloseConsumer or handleCloseProducer
3. The client starts to trigger the ConnectionClosed action, and then enters
the reconnection logic
4. In the reconnection logic, the GetConnection method will be called to
obtain a connection
Previously in GetConnection(), we obtained the old connection, and now we
want to change this behavior, expecting to remove the old connection object
from the connections map when the ConnectionClosed action is triggered, and
then from the GetConnection method. get a new connection
--
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]