We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
poll
remove
NoSuchElementException
1 parent b297f1f commit 402ed5bCopy full SHA for 402ed5b
1 file changed
pulsar-broker/src/main/java/org/apache/pulsar/client/impl/RawReaderImpl.java
@@ -218,7 +218,10 @@ protected CompletableFuture<Void> failPendingReceive() {
218
private void failPendingRawReceives() {
219
List<CompletableFuture<RawMessage>> toError = new ArrayList<>();
220
while (!pendingRawReceives.isEmpty()) {
221
- toError.add(pendingRawReceives.remove());
+ final CompletableFuture<RawMessage> ret = pendingRawReceives.poll();
222
+ if (ret != null) {
223
+ toError.add(ret);
224
+ }
225
}
226
toError.forEach((f) -> f.cancel(false));
227
0 commit comments