Comments (7)
Awesome. I'll include the read-write locks in the next release.
from node-rdkafka.
Judging from this comment, which says:
Each broker has its own thread so the initial blocking connect() does not affect any other part of the library.
I assume those threads, while trying to connect initially, will block the execution in librdkafka itself. But I would still like to know your opinion, as this is just my assumption here.
from node-rdkafka.
.produce
queues up a poll to get information about deliveries, etc. from kafka. I think what is happening potentially is that you are producing a message, which then queues up a poll. Poll is waiting for the connection to finish to actually get the next message, so the subsequent poll is blocking.
Can you make a test case that reproduces this behavior? If it is happening reliably, it is definitely unwanted behavior and I would like to fix it.
from node-rdkafka.
librdkafka-blocking-pool-poc.zip
here it comes... since we're working in Docker on Windows, I've included a docker file with instructions (2 lines of comments on top of Dockerfile) if you'd like to build this from scratch. Otherwise, this should work fine if you have librdkafka with NodeJS 6 on your machine.
from node-rdkafka.
It looks like this is a bug related to a deadlock. In the meantime, the Producer.produce
method is not meant to be used outside of a closure for the on('ready')
event or a callback from .connect
. In this situation, it would throw anyway.
However, that doesn't mean I don't want to fix the deadlock!
from node-rdkafka.
I implemented a read/write lock instead of the single mutex for connections. You can try running your application with the code at this branch here:
https://github.com/Blizzard/node-rdkafka/tree/deadlock-dr-cb
There are a few other fixes I need to put in before it is merge-able, but for the time being it will be there. Let me know how it works for you.
from node-rdkafka.
seems to work fine now, I'm getting info about brokers being offline without anything being blocked, thumbs up and thank you!
from node-rdkafka.
Related Issues (20)
- installation gives an error "cp: illegal option -- -" on Mac
- No such configuration property "connections.max.reauth.ms"
- Consumer is picking messages from single partition after adding 3 hours of delayed in consuming. HOT 1
- Some message is missing
- OpenSSL not available at build time HOT 1
- idempotence setting does not seem to work HOT 1
- Thread 15 "rdk:broker-1" received signal SIGSEGV, Segmentation fault. HOT 1
- consume callback has an incorrect typing
- Installation fails if any parent dir contains space
- Segfault when disconnecting right after consuming
- Build error when installing the module HOT 5
- Schema registry options
- _ZN2v88internal20CanHaveInternalFieldEi: symbol not found
- Cannot find ZSTD library on Mac M1 machine HOT 1
- Consuming messages from each partition separately HOT 2
- Denied Operation is getting triggered in node-rdkafka with incorrect principal
- Question: handling consumer stream errors gracefully (stream error, event.error)
- [FEATURE REQUEST] Allow to pass arbitrary compilation options to librdkafka via env variables
- [FEATURE REQUEST] Provide prebuilt binaries for each target triples HOT 1
- Kafka consumer reads same message again after consumer group rebalances
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-rdkafka.