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 2020/11/28 03:01:03 UTC

[GitHub] [pulsar] 315157973 opened a new pull request #8735: Fix reader always has message available

315157973 opened a new pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735


   Fixes #8721
   
   ### Motivation
   Whenever you create a new Reader with startMessageId set to latest and startMessageIdInclusive, hasMessageAvailable will be always true even if the topic is freshly created without any messages inside. If you remove message inclusiveness, then the issue is not appearing.
   
   ### Modifications
   If the returned entryId is illegal, it means there is no message
   
   ### Verifying this change
   ReaderTest#testReaderHasMessageAvailable


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 removed a comment on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 removed a comment on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735715730


   /pulsarbot run-failure-checks
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735047596


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735051701


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735637157


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on a change in pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
sijie commented on a change in pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#discussion_r532320394



##########
File path: pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java
##########
@@ -2010,11 +2010,16 @@ public boolean hasMessageAvailable() throws PulsarClientException {
                     startMessageId.partitionIndex == -1) {
 
                 getLastMessageIdAsync()
-                        .thenCompose(this::seekAsync)
-                        .whenComplete((ignore, e) -> {
+                        .thenCompose((msgId)-> seekAsync(msgId).thenApply((ignore)-> msgId))

Review comment:
       ```suggestion
                           .thenCompose((msgId) -> seekAsync(msgId).thenApply((ignore)-> msgId))
   ```




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735715730


   /pulsarbot run-failure-checks
   
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735720247


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735727956


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 removed a comment on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 removed a comment on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735720247


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] 315157973 commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
315157973 commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-735575055


   /pulsarbot run-failure-checks


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie commented on pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
sijie commented on pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735#issuecomment-736184602


   /pulsarbot cherry-pick to branch-2.7


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [pulsar] sijie merged pull request #8735: Fix reader always has message available

Posted by GitBox <gi...@apache.org>.
sijie merged pull request #8735:
URL: https://github.com/apache/pulsar/pull/8735


   


----------------------------------------------------------------
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:
users@infra.apache.org