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

fix: avoiding burning cpu if all partitions are paused #2532

Merged
merged 1 commit into from
Jul 29, 2023

Conversation

napallday
Copy link
Contributor

Sarama has addressed the issue of submitting empty fetch requests after calling PauseAll, as seen in #2143. However, there is still a CPU utilization problem.

The root cause lies in two operations:

  1. In subscriptionConsumer, if response is nil, it immediately attempts to fetch from the bc.newSubscriptions channel.

  2. In subscriptionManager, it continuously sends nil to bc.newSubscriptions.

These two operations alternate indefinitely until a rebalance or until ResumeAll/Resume is called. Consequently, this leads to the CPU burn issue.

Signed-off-by: napallday <bzx0619@gmail.com>
@dnwe dnwe added the fix label Jul 29, 2023
Copy link
Collaborator

@dnwe dnwe left a comment

Choose a reason for hiding this comment

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

LGTM, matches the other “naps” in this code

@dnwe dnwe merged commit aa72f59 into IBM:main Jul 29, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants