eolivelli commented on code in PR #18392:
URL: https://github.com/apache/pulsar/pull/18392#discussion_r1019286236
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/PersistentAcknowledgmentsGroupingTracker.java:
##########
@@ -57,6 +58,12 @@
@Slf4j
public class PersistentAcknowledgmentsGroupingTracker implements
AcknowledgmentsGroupingTracker {
+ private static final TimedCompletableFuture<Void> COMPLETED_FUTURE = new
TimedCompletableFuture<>();
Review Comment:
Because CompletableFuture is stateful and it has internal queues of pending
threads that wait for things to happen.
You usually create chains of other CompletionStage instances created by the
initial CF and this easily turns into unpredictable behaviour and also memory
leaks.
--
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]