jai1 opened a new pull request #556: CPP Client - Reducing number of duplicate lookups URL: https://github.com/apache/incubator-pulsar/pull/556 ### Motivation (A) During a graceful shutdown, the broker sends CLOSE_PRODUCER / CLOSE_CONSUMER command to the client, which triggers the reconnection logic. (B) After the connection is closed the ClientConnection.close() also triggers the reconnection logic for all registered consumers/producers. If (A) doesn't complete before (B) then lookups and CREATE_PRODUCER / CREATE_CONSUMER commands are sent twice - this is not a functional issue because the broker returns success for the duplicate command but this leads a twice the required number of lookups. ### Modifications Put all operation on the producers and consumers map (in ClientConnection) inside a lock. Remove the consumer/producer from producers/consumers map if CLOSE_PRODUCER / CLOSE_CONSUMER command is received. ### Result No functional change, lesser lookups. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
With regards, Apache Git Services
