dragosvictor commented on code in PR #21668:
URL: https://github.com/apache/pulsar/pull/21668#discussion_r1414692856


##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/persistent/PersistentTopic.java:
##########
@@ -1473,6 +1486,9 @@ public CompletableFuture<Void> close(
 
         lock.writeLock().lock();
         try {
+            if (!disconnectClients) {
+                transferring = true;

Review Comment:
   Just confirming that this flag is not meant to ever go back to `false`. Is 
that the intent? As it is right now, publishing a message to a topic that was 
transferred would lead to a `TopicClosedException`, whereas in the current 
proposal the exception would be silenced forever.



##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/Producer.java:
##########
@@ -485,6 +485,14 @@ public long getOriginalHighestSequenceId() {
         @Override
         public void completed(Exception exception, long ledgerId, long 
entryId) {
             if (exception != null) {
+                // if the topic is transferring, we don't send error code to 
the clients.
+                if (producer.getTopic().isTransferring()) {
+                    if (log.isDebugEnabled()) {
+                        log.debug("[{}] Received producer exception: {} while 
transferring.",
+                                producer.getTopic().getName(), 
exception.getMessage(), exception);
+                    }
+                    return;
+                }

Review Comment:
   Would we still need to execute the code inside the lambda below, except the 
error sending? There's other cleanup operations being performed that can avoid 
resource 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]

Reply via email to