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

At closing consumer: make pendingRead false when no consumer is connected to SingleDispatcher #60

Closed
wants to merge 1 commit into from

Conversation

rdhabalia
Copy link
Contributor

Motivation

In case of Exclusive consumer is disconnecting and if it doesn't flip havePendingRead=false at PersistentDispatcherSingleActiveConsumer, then on next reconnection consumer will not receive new messages and it will be blocked.
So, we should make havePendingRead=false at the time of disconnect-consumer if there is no consumer available

  • next time when new consumer will connect it will anyway read more entires without considering pendingRead
  • however, in case of Exclusive subscription: if havePendingRead=true and cursor.cancelPendingReadRequest()=false (which will be the case if there is no pendingReadOp present at ManagedCursor), havePendingRead will be always true and next time when new consumer will connect, it might get blocked at pickAndScheduleActiveConsumer while addConsumer() and at consumerFlow

Modifications

Always clear pendingRead at Exclusive consumer disconnect.

Result

Avoid possibility of exclusive consumer blocking.

@yahoocla
Copy link

CLA is valid!

@rdhabalia rdhabalia closed this Oct 13, 2016
@rdhabalia rdhabalia deleted the singleDis branch November 11, 2016 23:03
sijie pushed a commit to sijie/pulsar that referenced this pull request Mar 4, 2018
* Added atmost once and atleast once semantics

* Added ability to specify processing guarantees in command line
hangc0276 pushed a commit to hangc0276/pulsar that referenced this pull request May 26, 2021
In RequestHandler, we use `PersistentTopicsBase.getPartitionedTopicMetadata` to get topic metadata. This need to passed in `authRole`. While with pulsar auth disable, or KoP SASL auth enable, both will work OK. But with pulsar auth enabled, and KoP SASL auth disable, it may meet problem.

This change changed to use `admin.topics().getPartitionedTopicMetadataAsync` to get metadata. By this way, the pulsar auth is still enable in the internal pulsar-admin/pulsar-client, and will not affect KoP.
cbornet pushed a commit to cbornet/pulsar that referenced this pull request Apr 5, 2022
dlg99 pushed a commit to dlg99/pulsar that referenced this pull request May 11, 2022
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