Skip to content

Conversation

@RobertIndie
Copy link
Contributor

Motivation

Bring this fix apache/pulsar#22363 to the pulsar-client-dotnet

The reader's HasMessageAvailableAsync may return true after a timestamp-based seek, even if there are no available messages in the topic.

Modifications

Add a boolean flag HasSoughtByTimestamp to represent whether the last seek call accepts a timestamp. If it's true, don't take startMessageId into comparison with lastMessageIdInBroker, just compare the mark-delete position and last position in the GetLastMessageId response.

@RobertIndie RobertIndie marked this pull request as ready for review October 29, 2025 12:09
and private set value = Volatile.Write(&lastMessageIdInBroker, value)

member this.HasSoughtByTimestamp
with get() = Volatile.Read(&hasSoughtByTimestamp)
Copy link
Member

@Lanayx Lanayx Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The HasSoughtByTimestamp property is unused, so not needed


// The Seek operation does not implement a backoff mechanism. It will fail if the connection is not
// ready, so wait for a short period until the connection becomes available.
do! Async.Sleep(1000)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Task.Delay here and below

@Lanayx Lanayx merged commit e894e66 into fsprojects:develop Oct 30, 2025
2 checks passed
@Lanayx
Copy link
Member

Lanayx commented Oct 30, 2025

Thank you, released 3.12.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants