poorbarcode commented on code in PR #19737:
URL: https://github.com/apache/pulsar/pull/19737#discussion_r1162256669


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1009,17 +1057,15 @@ private CompletableFuture<? extends Subscription> 
getNonDurableSubscription(Stri
                 }
 
                 Position startPosition = new PositionImpl(ledgerId, entryId);
-                ManagedCursor cursor = null;
                 try {
-                    cursor = ledger.newNonDurableCursor(startPosition, 
subscriptionName, initialPosition,
-                            isReadCompacted);
+                    final ManagedCursor cursor = 
ledger.newNonDurableCursor(startPosition, subscriptionName,
+                            initialPosition, isReadCompacted);
+                    subscriptions.computeIfAbsent(subscriptionName, k ->

Review Comment:
   I feel it is not a necessary change, so I reverted it



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