BewareMyPower commented on code in PR #18406:
URL: https://github.com/apache/pulsar/pull/18406#discussion_r1019091691
##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:
##########
@@ -1296,6 +1296,9 @@ private void checkRequestTimeout() {
break;
}
request = requestTimeoutQueue.poll();
Review Comment:
> remove() will throw a NoSuchElementException when the queue is empty.
No. I mean the `remove(Object)` API. See the following examples:
```java
var list = new ConcurrentLinkedQueue<String>();
list.add("hello");
var s = list.peek();
list.clear(); // assuming another thread remove the value
System.out.println(list.isEmpty()); // true
boolean removed = list.remove(s); // no exception would be thrown
System.out.println(removed); // false
```
--
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]