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

flame graph shows hotspot for reading from producer events #1143

Open
ORESoftware opened this issue Feb 25, 2024 · 0 comments
Open

flame graph shows hotspot for reading from producer events #1143

ORESoftware opened this issue Feb 25, 2024 · 0 comments

Comments

@ORESoftware
Copy link

ORESoftware commented Feb 25, 2024

Description

the code is like:

    go func(i int) {
        //
        for e := range producer.Events() {
          //
          switch ev := e.(type) {
      
          case *kafka.Message:
            if ev.TopicPartition.Error != nil {
              vbl.Stdout.Warn(vbl.Id("bd9932dd-11ea-43ed-a7dc-c6e25aa33e73"), e)
              createNewProducer(i)
            }
            break; // break out of switch not loop
      
          case *kafka.Error:
            // Handle general errors, including possible disconnection
            vbl.Stdout.Warn(vbl.Id("2ea64bc1-b99a-4999-b8fb-1512e6dea09b"), e)
            createNewProducer(i)
            break; // break out of switch not loop
      
          case kafka.Error:
            // Handle general errors, including possible disconnection
            vbl.Stdout.Warn(vbl.Id("d5982db1-0af9-4b82-b058-4a5d272e6e29"), e)
            createNewProducer(i)
            break; // break out of switch not loop
      
          }
        }
      }(i)

How to reproduce

the flame graph was like this:

Screenshot 2024-02-24 at 8 25 48 PM

see the center - kafka.NewProducer.func5

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

No branches or pull requests

1 participant