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


##########
pulsar-common/src/main/java/org/apache/pulsar/common/util/collections/GrowableArrayBlockingQueue.java:
##########
@@ -127,6 +132,13 @@ public boolean offer(T e) {
 
     @Override
     public void put(T e) {
+        if (terminated){

Review Comment:
   If we don't lock first and then judge, it seems that there will be legacy 
messages
   
   |  put   | terminate  |
   |  ----  | ----  |
   | execute if (terminated) {...}  |  |
   |  |  The terminate method is completely executed |
   | Execute the remaining logic of the put method ||



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