Jason918 commented on a change in pull request #13204:
URL: https://github.com/apache/pulsar/pull/13204#discussion_r770265023



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -2274,6 +2289,26 @@ private void updateManagedLedgerConfig() {
         configRegisteredListeners.put(configKey, listener);
     }
 
+    public <T> void 
registerPublishBufferLimitListener(Consumer<PublishBufferEvent> listener) {

Review comment:
       No unregister? This will cause object leak.

##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
##########
@@ -276,6 +279,12 @@
     private Set<BrokerEntryMetadataInterceptor> 
brokerEntryMetadataInterceptors;
     private Set<ManagedLedgerPayloadProcessor> brokerEntryPayloadProcessors;
 
+    private final CopyOnWriteArrayList<Consumer<PublishBufferEvent>>

Review comment:
       I would prefer a better data structure than `CopyOnWriteArrayList` if we 
have a lot of producers.




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