lhotari commented on code in PR #22854:
URL: https://github.com/apache/pulsar/pull/22854#discussion_r1628920203


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PatternMultiTopicsConsumerImpl.java:
##########
@@ -69,6 +69,31 @@ public class PatternMultiTopicsConsumerImpl<T> extends 
MultiTopicsConsumerImpl<T
     private volatile Timeout recheckPatternTimeout = null;
     private volatile String topicsHash;
 
+    /**
+     * This variable is used to make all tasks that will modify subscriptions 
will be executed one by one.

Review Comment:
   Interesting solution. Does the current solution of chaining the futures 
introduce a memory leak?
   
   One possible solution for limiting concurrency of asynchronous calls is to 
use [ConcurrencyReducer from 
com.spotify:completable-futures](https://github.com/spotify/completable-futures/blob/master/src/main/java/com/spotify/futures/ConcurrencyReducer.java).
  
   
   In this case, limiting concurrency would be useful for a few locations where 
all asynchronous operations happen concurrently. For example, the code where 
`consumer.closeAsync()` is called happens all at once. 
   It might not be a problem in this case since binary protocol calls will go 
on the same set of connections. For Pulsar Admin API calls, there are problems 
for example in topic deletion where concurrency isn't limited (problem 
explained in 
https://github.com/apache/pulsar/pull/22541#issuecomment-2071568113).



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