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


##########
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:
   No, this variable `wasEmpty` is in use after the release of the lock.
   
   <img width="675" alt="截屏2023-03-02 11 16 27" 
src="https://user-images.githubusercontent.com/25195800/222322072-db3b2e0e-eb9d-43ec-9661-2163c6a94ca2.png";>
   



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