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
has_message_available() with timestamp seek returns True on first call when reaching end of the topic #267
Ran into this while trying to upgrade to the v3.8.0 Python client. Tested on a Pulsar v4.0.4 cluster, which is after this issue was fixed in Pulsar v4.0.1.
Seek by timestamp to a point where there's messages after it
read_next() until there's no more messages
Then the next has_message_available() call returns True, even though there's no more messages afterwards. Additionally, calling has_message_available() again correctly returns False, meaning that this bug only happens the first time.
Initially there's a lot of True True True, for messages in the past while the reader is catching up
Once the reader catches up, the outputs become True False False, indicating that the first has_message_available() call each time is incorrectly giving True
Expected output:
Once the reader has caught up, the outputs should be False False False, since there's no message available and read_next() needs to block until a new message comes in.
Notes:
The bug doesn't seem to happen if there's no seek by timestamp done at the start.
The bug doesn't seem to happen if there's a small delay after the read_next() (e.g. time.sleep(0.1)) -- for this it's easier to observe if you make the producer publish slower.
The bug was probably introduced in v3.5.0, since it does not occur with the v3.4.0 client but it does with the v3.5.0 client.
Activity
abeliangroupie commentedon Jul 22, 2025
Noting here that there's a similar open issue #221 but that's different because
is_read_compacted=Trueisn't needed to reproduce here.BewareMyPower commentedon Aug 15, 2025
Yes, it can be reproduced easily with the following script.
BewareMyPower commentedon Aug 15, 2025
It's an upstream issue. I pushed a fix for it: apache/pulsar-client-cpp#498