wenbingshen opened a new issue #676:
URL: https://github.com/apache/pulsar-client-go/issues/676


   #### Expected behavior
   
   When reconnecting to the server, the old connection should be closed.
   
   #### Actual behavior
   
   When reconnecting to the server, the old connection is not closed.
   
   The following log progresses according to the timeline:
   
   1. First, there is an active channel and producer that is writing data to 
the broker
   
![image](https://user-images.githubusercontent.com/35599757/144197104-d67b3017-bccf-4a17-9c86-6291106ddf9a.png)
   
   2. In the case that the previous connection has not been disconnected, the 
client sends an add producer operation for the same producerName
   
![image](https://user-images.githubusercontent.com/35599757/144197282-4ad0800f-2e6c-4894-9c93-d5231e028688.png)
   
   3. This addition operation comes from the same ip of the client, a different 
port connection, and the producerName is equal to the previous one
   
![image](https://user-images.githubusercontent.com/35599757/144197661-ca977e2b-b0b7-4bde-b242-c52cf9eaf7b5.png)
   
   4. Remove the producer in ServerCnx from the pulsar server, 
https://github.com/apache/pulsar/pull/11804, this PR modified the equals method 
of the Producer, resulting in the inability to remove the producer from the 
topic's prodcuers map.
   
![image](https://user-images.githubusercontent.com/35599757/144197941-922d7e32-3e65-4310-b025-d2d47c8fb85a.png)
   
   5. Then the old connection starts to be disconnected, and the producer 
status of the server on the connection is cleared
   
![image](https://user-images.githubusercontent.com/35599757/144198510-cb56745b-2efe-4724-a679-c02b6ac9deab.png)
   
   
![image](https://user-images.githubusercontent.com/35599757/144198722-a9f17948-7d35-4c86-9ab3-629a3fa6af9e.png)
   
   6. The new channel connection keeps retrying addProducer, and the producer 
is added successfully after closing the old connection.
   
   #### Steps to reproduce
   
   
   #### System configuration
   **Pulsar version**: x.y
   
   pulsar-client-go: 0.7.0
   pulsar broker: 2.8.1
   
   


-- 
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]


Reply via email to