GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [fix][client] Resume a multi-topics consumer's paused partitions while a batch receive waits for messages by merlimat · Pull Request #27597 · apache/pulsar Conversation
Contributor
MotivationProblem: a multi-topics consumer (partitioned topic or several topics) whose
Example: if (size >= maxReceiverQueueSize || (size > sharedQueueResumeThreshold && !pausedConsumers.isEmpty())) { pausedConsumers.add(consumer); The paused partitions resume only when the queue drops to half: if (incomingMessages.size() <= getCurrentReceiverQueueSize() / 2 && !pausedConsumers.isEmpty()) { With a queue of 50, a batch of 50 and no timeout:
Modifications
if (size <= maxReceiverQueueSize / 2 || (size < maxReceiverQueueSize && hasPendingBatchReceive())) {
Verifying this change
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…e a batch receive waits for messages A multi-topics consumer pauses a partition consumer when its shared queue is full, and resumes the paused ones only once the queue drops to half of the receiver queue size. A batch receive takes nothing until it has its batch, so with maxNumMessages above half of the receiver queue (the builder raises the queue to at least maxNumMessages) and the queue left between the two, the batch receive waited for its timeout, or forever without one, while the paused partitions held the messages it needed. Also resume the paused consumers while a batch receive is pending and the queue is not full. This fixes ConsumerBatchReceiveTest.testBatchReceivePartitionedTopic hanging until its 300 s timeout.
codelipenghui
approved these changes
Uh oh!
There was an error while loading. Please reload this page.
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…e a batch receive waits for messages (apache#27597) (cherry picked from commit 1ef4e5c)
poorbarcode
pushed a commit
to poorbarcode/pulsar
that referenced
this pull request
…e a batch receive waits for messages (apache#27597) (cherry picked from commit 1ef4e5c)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabelsProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later. |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |