question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Could Producer.produce() be blocking NodeJS thread?

See original GitHub issue

Hi,

While doing some fail tests, I’ve discovered that when I use this library and it can’t connect a broker during application startup (i.e. the first connect - we supply multiple brokers via options), the Producer.produce() method will work the first time and then, upon subsequent call to the same method, NodeJS thread will hang until error about all brokers being offline is emitted.

Is this something that’s related to node-rdkafka, or could this actually be librdkafka behaving this way?

Thanks!

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
webmakerstevecommented, Jan 27, 2017

Awesome. I’ll include the read-write locks in the next release.

0reactions
martinambruscommented, Jan 27, 2017

seems to work fine now, I’m getting info about brokers being offline without anything being blocked, thumbs up and thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Don't Block the Event Loop (or the Worker Pool) - Node.js
Node. js has two types of threads: one Event Loop and k Workers. The Event Loop is responsible for JavaScript callbacks and non-blocking...
Read more >
When is Node.js blocking? - Stack Overflow
So the I/O tasks are non-blocking because of asynchronous callbacks, but the single thread can be blocking, because it's synchronous and because ...
Read more >
Learning Kafka - Writing a Kafka Producer in Node.js - Blog
It is important to note that each producer.flush() call blocks up one libuv thread each. If there are 4 libuv threads and 8...
Read more >
Understanding Non-Blocking I/O in JavaScript | Codementor
When a thread invokes a read() or write() operation, that thread is blocked until there is some data to read, or the data...
Read more >
Producer-Consumer solution using threads in Java
Object of a class that has both produce() ... Inside this loop, we have a synchronized block so that only a producer or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found