You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2021/10/22 14:41:23 UTC
[GitHub] [pulsar] michaeljmarshall commented on a change in pull request #12456: [Java Client] Remove data race in MultiTopicsConsumerImpl to ensure correct message order
michaeljmarshall commented on a change in pull request #12456:
URL: https://github.com/apache/pulsar/pull/12456#discussion_r734603705
##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/MultiTopicsConsumerImpl.java
##########
@@ -409,17 +410,18 @@ private void resumeReceivingFromPausedConsumersIfNeeded() {
protected CompletableFuture<Message<T>> internalReceiveAsync() {
CompletableFutureCancellationHandler cancellationHandler = new CompletableFutureCancellationHandler();
CompletableFuture<Message<T>> result = cancellationHandler.createFuture();
- Message<T> message = incomingMessages.poll();
- if (message == null) {
- pendingReceives.add(result);
- cancellationHandler.setCancelAction(() -> pendingReceives.remove(result));
- } else {
- decreaseIncomingMessageSize(message);
- checkState(message instanceof TopicMessageImpl);
Review comment:
@lhotari - yes, it was intentional to remove it, but I agree that this shouldn't be removed for this PR. I just added it back in.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org