You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2018/10/02 20:51:38 UTC

[GitHub] merlimat opened a new pull request #2699: Do not register each DispatchRateLimiter for policies notifications

merlimat opened a new pull request #2699: Do not register each DispatchRateLimiter for policies notifications
URL: https://github.com/apache/pulsar/pull/2699
 
 
   ### Motivation
   
   There is a memory leak that can be visible when there are many topics that are cycled through (created and deleted). 
   
   The problem resides in that the `DispatchRateLimiter` register itself as a listener on the policies cache, but it never unregister.  This leaves the `DispatchRateLimiter` instance hanging around even when the topic is not used anymore in a broker.
   
   ### Modifications
   
    * Removed the individual registration. `policiesCache().registerListener()` was not meant to have many listeners (as in one per topic) but rather as a way for multiple subcomponents to piggyback on the watch notifications. More the CopyOnWriteList is not efficient for multiple add and remove. 
   
    * Keep registration at broker service level and then just rely on topic instance to call the `onPoliciesUpdate()`.
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services