315157973 commented on code in PR #19585:
URL: https://github.com/apache/pulsar/pull/19585#discussion_r1122555591


##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/GrowableArrayBlockingQueue.java:
##########
@@ -132,6 +137,13 @@ public void put(T e) {
         boolean wasEmpty = false;
 
         try {
+            if (terminated){
+                if (itemAfterTerminatedHandler != null) {
+                    itemAfterTerminatedHandler.accept(e);
+                }
+                return;
+            }
+

Review Comment:
   `if (terminated){..}` should move before `boolean wasEmpty = false;` and 
after `long stamp = tailLock.writeLock();`
   
   `boolean wasEmpty = false;` should move in try block



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