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 2019/03/06 02:11:31 UTC

[GitHub] [pulsar] merlimat opened a new pull request #3764: Fixed Reader.HasNext() in Go client

merlimat opened a new pull request #3764: Fixed Reader.HasNext() in Go client
URL: https://github.com/apache/pulsar/pull/3764
 
 
   ### Motivation
   
   In Go client, the `Reader.HasNext()` is currently broken because it returns "true" when there are no more messages to read. 
   
   The issue is in the C++ `Consumer::hasMessageAvailable()`, combined with the use of message listener. The `lastDequedMessage` is being updated only after the listener is triggered, therefore an app checking `hasMessageAvailable()` from the listener thread will always be 1 message behind.
   
   Since Go client wrapper, uses the listener internally, it is affected by this problem and it looks like a race condition with the `lastDequedMessage` being updated in a background thread.

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


With regards,
Apache Git Services