From 0b6804d933b6e428f5495593e7cab75b9c54e6d6 Mon Sep 17 00:00:00 2001 From: pengxiangrui127 <67997328+pengxiangrui127@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:12:40 +0800 Subject: [PATCH] Update TopicLookupBase.java [Bug] Fix lookupRequestSemaphore leak when topic not found via http protocol --- .../java/org/apache/pulsar/broker/lookup/TopicLookupBase.java | 1 + 1 file changed, 1 insertion(+) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java index 1d984409fe7e2..83c06bb4347eb 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/lookup/TopicLookupBase.java @@ -79,6 +79,7 @@ protected CompletableFuture internalLookupTopicAsync(final TopicName }) .thenCompose(exist -> { if (!exist) { + pulsar().getBrokerService().getLookupRequestSemaphore().release(); throw new RestException(Response.Status.NOT_FOUND, String.format("Topic not found %s", topicName.toString())); }