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/04/28 05:40:42 UTC

[GitHub] [pulsar] 315157973 opened a new pull request #10414: Fix hasMessageAvailable return true but can't read message

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


   ### Motivation
   
   I temporarily fixed this problem in PR https://github.com/apache/pulsar/pull/10190.
   Now we have found a better way, this way can avoid the seek, then avoid trigger another reconnection.
   Thank you @codelipenghui  to troubleshoot this issue with me all night.
   
   We have added a lot of log and found that this issue is caused by some race condition problems. Here is the first reason:
   https://github.com/apache/pulsar/blob/f2d72c9fc13a33df584ec1bd96a4c147774b858d/pulsar-client/src/main/java/org/apache/pulsar/client/impl/ConsumerImpl.java#L1808-L1818
   Now we have an acknowledgmentsGroupingTracker to filter duplicate messages, and this Tracker will be cleaned up after seek.
   
   However, it is possible that the connection is ready and Broker has pushed message, but `acknowledgmentsGroupingTracker.flushAndClean(); ` has not been executed yet. 
   
   At this time hasMessageAvailableAsync returns true, but the message cannot be read because it is filtered by the acknowledgmentsGroupingTracker
   
   
   ### Modifications
   clean the tracker when connection was open
   
   ### Verifying this change
   
   


-- 
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] lhotari commented on pull request #10414: Fix hasMessageAvailable return true but can't read message

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


   I wonder if #7796 and #7848 are anyhow related to this fix? 


-- 
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 #10414: Fix hasMessageAvailable return true but can't read message

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


   > I wonder if #7796 and #7848 are anyhow related to this fix?
   
   There are many reasons for this problem, this is just one of the scenarios, for example: there are messages in incomeQueue, but they cannot be consumed. there will be follow-up pr to fix this problem.
   I've seen it, and this pr can't cover his scene
   What can be confirmed now is that all the flaky tests in MultiTopicsReaderTest have been resolved
   
   


-- 
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 #10414: Fix hasMessageAvailable return true but can't read message

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


   


-- 
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