Code Monkey home page Code Monkey logo

Comments (7)

edenhill avatar edenhill commented on September 13, 2024

Hi Andre,

what version/branch is this? 0.7 or 0.8/master?

from librdkafka.

edenhill avatar edenhill commented on September 13, 2024

How many rd_kafka_t objects are you creating, with how many topics, and how many brokers are available in the cluster?
Also; are you creating and destroy multiple rd_kafka_t objects? (i.e., shortlived)

from librdkafka.

andrerigon avatar andrerigon commented on September 13, 2024

Hi Magnus,

I'm using version 0.8/master.
I create a rd_kafka_t per reques:

rd_kafka_t *rk = rd_kafka_new(RD_KAFKA_PRODUCER, &conf,
errstr, sizeof(errstr));

than send the msg and wait:

rd_kafka_topic_t *rkt = rd_kafka_topic_new(rk, topic, &topic_conf);

rd_kafka_produce(rkt, partition,
RD_KAFKA_MSG_F_FREE, msg, strlen(msg),
"nginx", 5,
NULL);

rd_kafka_poll(rk, 0);

and finally:

rd_kafka_destroy(rk);

Thanks!

from librdkafka.

edenhill avatar edenhill commented on September 13, 2024

Thanks for clarifying your setup.

My guess is that the broker threads created by rdkafka arent properly terminated on rd_kafka_destroy() and that is clearly a bug that I will look into.

If possible I suggest that you try to hang on to the rd_kafka_t object and reuse it in subsequent rd_kafka_produce() calls to amortize the startup cost of connecting to the broker(s) and fetching metadata for each produced message. Not only will it avoid the above bug but it will provide a far more performant and resource frugal setup.
Would that be possible in your case?

from librdkafka.

edenhill avatar edenhill commented on September 13, 2024

I'm working on a fix, should be available end of this week.

from librdkafka.

edenhill avatar edenhill commented on September 13, 2024

Andre, could you please pull the latest master and give it another go?
This issue should now be fixed and it would be great if you could verify it in your setup.
Reopen this issue if the problem remains.

from librdkafka.

andrerigon avatar andrerigon commented on September 13, 2024

Hi,

the problem is gone with the fix.

thanks!

from librdkafka.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.