This is an automated email from the ASF dual-hosted git repository.

mmerli pushed a commit to branch branch-4.0
in repository https://gitbox.apache.org/repos/asf/pulsar.git


The following commit(s) were added to refs/heads/branch-4.0 by this push:
     new 6a614640335 [fix][client] Fix memory leak in ClientCnx.newLookup when 
there's TooManyRequestsException (#23971)
6a614640335 is described below

commit 6a614640335789de8d9694212f58207131831202
Author: Lari Hotari <[email protected]>
AuthorDate: Thu Feb 13 01:29:54 2025 +0200

    [fix][client] Fix memory leak in ClientCnx.newLookup when there's 
TooManyRequestsException (#23971)
---
 pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java 
b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
index 35c41455e89..ab02c89c298 100644
--- a/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
+++ b/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java
@@ -925,6 +925,7 @@ public class ClientCnx extends PulsarHandler {
             if (maxLookupRequestSemaphore.tryAcquire()) {
                 waitingLookupRequests.add(Pair.of(requestId, Pair.of(request, 
future)));
             } else {
+                request.release();
                 if (log.isDebugEnabled()) {
                     log.debug("{} Failed to add lookup-request into waiting 
queue", requestId);
                 }

Reply via email to