dugenkui03 commented on a change in pull request #13277: URL: https://github.com/apache/flink/pull/13277#discussion_r481163983
########## File path: flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/ClosableBlockingQueue.java ########## @@ -176,17 +178,17 @@ public boolean close() { public boolean addIfOpen(E element) { requireNonNull(element); - lock.lock(); + writeLock.lock(); try { if (open) { elements.addLast(element); if (elements.size() == 1) { - nonEmpty.signalAll(); + nonEmpty.signal(); Review comment: `signal()` is safe and reasonable, since all the threads which waiting on the `nonEmpty` Condition wish to take element from queue, and at most one thread can get element from queue. ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org