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

Kafka consumer consumes all CPU when shutting down the broker #14366

Closed
gunnarmorling opened this issue Jan 18, 2021 · 8 comments · Fixed by #14732
Closed

Kafka consumer consumes all CPU when shutting down the broker #14366

gunnarmorling opened this issue Jan 18, 2021 · 8 comments · Fixed by #14732
Labels
Milestone

Comments

@gunnarmorling
Copy link
Contributor

With SmallRye Reactive Messaging Kafka, when shutting down the broker, an application consuming topics will spike up to 100% CPU usage.

// CC @cescoffier

@gunnarmorling gunnarmorling added the kind/bug Something isn't working label Jan 18, 2021
@ghost ghost added the triage/needs-triage label Jan 18, 2021
@cescoffier
Copy link
Member

Do you have a reproducer? That's weird...

@gsmet
Copy link
Member

gsmet commented Jan 18, 2021

@gunnarmorling if you don't have a reproducer, maybe a thread dump would help?

@gunnarmorling
Copy link
Contributor Author

One reproducer, albeit not exactly minimal is here: https://github.com/debezium/debezium-examples/tree/master/distributed-caching#running-the-quarkus-services-locally-in-dev-mode. Make sure to adjust the exposed host name in the Compose file as described; then:

export DEBEZIUM_VERSION=1.4
docker-compose up --build --scale order-service=0 --scale cache-update-service=0 --scale pgadmin=0

# wait until everything is up
mvn compile quarkus:dev -f cache-update-service/pom.xml

Then stop the broker (docker-compose down), and CPU gets usurpated.

@cescoffier
Copy link
Member

I believe I know what's happening. The last time I checked it was not possible to configure the Kafka Network Client, and it was retrying to connect without any delay. I will have another look this afternoon.

@cescoffier
Copy link
Member

cescoffier commented Jan 21, 2021

Fixed upstream. (keeping it opened as I will close it when we update Quarkus with SmallRye Reactive Messaging 2.8.0)

@cescoffier
Copy link
Member

@tsegismont investigated, and it seems to be a Kafka Client 2.5 issue. It does behave correctly with 2.6.

@cescoffier cescoffier linked a pull request Feb 1, 2021 that will close this issue
@cescoffier cescoffier removed their assignment Feb 1, 2021
@cescoffier
Copy link
Member

For the record: https://issues.apache.org/jira/browse/KAFKA-10134.

@gunnarmorling
Copy link
Contributor Author

gunnarmorling commented Feb 2, 2021 via email

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 a pull request may close this issue.

3 participants