You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Reader.has_message_available() returns True even if no messages to consume, when start_message_id is earliest #199
Hi,
Reader.has_message_available() returns True on first execution, even if no message available on topic. Issue is only, when reader is created with start_message_id=pulsar.MessageId.earliest,
Environment:
Python 3.11.5
pulsar-client 3.4.0
Reproduction
Create reader with start_message_id=pulsar.MessageId.earliest:
Seek MessageId.latest or timestamp after point, where is no more messages
reader.seek(pulsar.MessageId.latest)
read messages until no more messages available
while reader.has_message_available(): # It is True on first iteration but should be False
msg = reader.read_next(timeout_millis=5000)
print("No more messages")
At point 3 I should get info log "No more messages", but I got Timeout exception.
Activity
BewareMyPower commentedon Mar 1, 2024
It's a bug of C++ client, I will fix it ASAP.
Fix race condition of hasMessageAvailable by reading latest startMess…
Fix race condition of hasMessageAvailable by reading latest startMess…
Fix race condition of hasMessageAvailable by reading latest startMess…
[fix][client] fix Reader.hasMessageAvailable might return true after …
[fix][client] fix Reader.hasMessageAvailable might return true after …
BewareMyPower commentedon Mar 12, 2024
The fix apache/pulsar-client-cpp#409 is included in the C++ client 3.5.0.
Add tests for apache#199
Upgrade the C++ client to 3.5.0 for some bug fixes