Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] readNext() hangs if you configure a Pulsar Reader with MessageId.earliest and seek() before reading #23917

Open
2 of 3 tasks
dmonopoly opened this issue Jan 31, 2025 · 1 comment
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@dmonopoly
Copy link

dmonopoly commented Jan 31, 2025

Search before asking

  • I searched in the issues and found nothing similar.

Read release policy

  • I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.

Version

Pulsar 3

Minimal reproduce step

If you create a reader like so

var partitionReader: Reader<ByteArray>? =
                client
                    .newReader(BYTES)
                    .startMessageId(MessageId.earliest)
                    .topic(topic)
                    .create()

then call seek to some timestamp that is certainly within a valid range of time where there are messages after

pulsarReader.seek(timestamp)

readNext() will hang.

if (!pulsarReader.hasMessageAvailable()) {
            logger.info("No messages from this starting timestamp")
            return null
}        
var nextMsg = pulsarReader.readNext()

What did you expect to see?

readNext() returns the next message, or hasMessageAvailable() returns false

What did you see instead?

hangs

Anything else?

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR!
@dmonopoly dmonopoly added the type/bug The PR fixed a bug or issue reported a bug label Jan 31, 2025
@dmonopoly
Copy link
Author

dmonopoly commented Jan 31, 2025

This doesn't happen if you create the reader with startMessageIdInclusive(), though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

No branches or pull requests

1 participant