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

[Issue 729]stop ticker when create producer failed #730

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

NaraLuwan
Copy link
Contributor

@NaraLuwan NaraLuwan commented Feb 17, 2022

Master Issue: [#729 ]

Motivation

I received an alarm indicating that the server load was too high, used the pprof tool to locate the problem and determined that the cause was a ticker leak while a large number of producer creating failed.
Here are some screenshots to show it:

  • pprof heap, there are a number of SDK-started ticker, accounted for 90%
    image
  • pprof cpu, cpu consumption is also here
    image

Modifications

stop ticker when create producer failed

@wolfstudy wolfstudy added this to the v0.9.0 milestone Feb 18, 2022
Copy link
Member

@wolfstudy wolfstudy left a comment

Choose a reason for hiding this comment

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

Thanks @NaraLuwan work for this, just a little comments, please check

@@ -145,6 +145,7 @@ func newPartitionProducer(client *client, topic string, options *ProducerOptions
}
err := p.grabCnx()
if err != nil {
p.batchFlushTicker.Stop()
Copy link
Member

Choose a reason for hiding this comment

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

The grabCnx() is called in two places in total, except here in thereconnectToBroker() logic, it looks like we need the same fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but newTicker() is called only with newPartitionProducer(), i don't think we need to fix it.

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.

3 participants