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

probable memory leak observed after deploying delivery.report.only.error=true #306

Closed
4 of 7 tasks
Navgeet opened this issue Mar 14, 2019 · 5 comments
Closed
4 of 7 tasks
Labels

Comments

@Navgeet
Copy link

Navgeet commented Mar 14, 2019

Description

We deployed a build last night that turned off success acks. Exactly since the deployment, we're seeing monotonically increasing memory usage, which points to a memory leak. We're attaching the difference of two heap dumps taken 30mins apart.

How to reproduce

This issue was observed in production. We're working on reproducing this in a load environment.

Checklist

Please provide the following information:

  • confluent-kafka-go and librdkafka version (LibraryVersion()): both v0.11.6
  • Apache Kafka broker version: confluent 4.1.2 (kafka 1.1.1-cp1)
  • Client configuration:
		"statistics.interval.ms":     10000,
		"delivery.report.only.error": true,
		"compression.codec":          "gzip"
  • Operating system: ubuntu 16.04
  • Provide client logs (with "debug": ".." as necessary)
  • Provide broker log excerpts
  • Critical issue

profile002

@edenhill
Copy link
Contributor

Thanks for the heap dumps, very useful!

For each message produced the Go client allocates a small state object (cgoDr) which is later freed when the delivery report is received.
When successful delivery reports are disabled these cgoDr memory objects are never freed, and that is what you are seeing here.

What we'll need to do is intercept the configuration property and not passing it on to librdkafka, but instead filter out the successful delivery reports on the Go side instead so that the cgoDr object can be freed.

Until that fix is in we recommend not to set delivery.report.only.error.

@edenhill edenhill added the bug label Mar 14, 2019
@Navgeet
Copy link
Author

Navgeet commented Mar 14, 2019

Thanks. Until this is fixed, we should also add a note to the README against setting this.

@edenhill
Copy link
Contributor

I think we should fail NewProducer if this property is set.

edenhill added a commit that referenced this issue Mar 14, 2019
.. to avoid a cgoDr memory leak per successful message.
edenhill added a commit that referenced this issue Mar 14, 2019
.. to avoid a cgoDr memory leak per successful message.
edenhill added a commit that referenced this issue Mar 21, 2019
.. to avoid a cgoDr memory leak per successful message.
edenhill added a commit that referenced this issue Mar 23, 2019
.. to avoid a cgoDr memory leak per successful message.
@Navgeet
Copy link
Author

Navgeet commented Mar 28, 2019

Hi, is this getting fixed in the upcoming 1.0 release?

@edenhill
Copy link
Contributor

Fixed as in support it, or reject it?
The upcoming v1.0 release (master branch) rejects the property, and I believe that is the best option a this point: your application can filter out non-errored deliveries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants