-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Error: Local: Host resolution failure #2171
Comments
You're absolutely right, the max nodename/hostname size should be 256. |
I am getting this error with the CPP version of librdkafka. |
I should add that this is not an issue I face all the time. 7/10 times everything works fine and Producers are created, but every now and then randomly I get this issue. |
@rana13deb What error are you seeing? |
@rana13deb did you find the solution ? |
If you comment out listeners = listener_name://ip:port, you should modify the client's hosts file and connect using hostname. |
Read the FAQ first: https://github.com/edenhill/librdkafka/wiki/FAQ
Description
I was working with node-rdkafka and observed this error. After further debugging the issue I found that error seems to appear from native library which node-rdkafka use i.e librdkafka.
After spending sometime on it we figured out that there is a limit on hostname size.
Which is set
rdkafka_proto.h
#define RD_KAFKA_NODENAME_SIZE 128
This is trimming the host name and resulting the error.
How to reproduce
This error will come if broker host is big enough. Also this error still come if we try to give IPs as IPs will get resolved to the hostname. After changing NODENAME_SIZE. It worked.
#define RD_KAFKA_NODENAME_SIZE 256
Let me know if this fix can be incorporated in any of the release. Thanks
IMPORTANT: Always try to reproduce the issue on the latest released version (see https://github.com/edenhill/librdkafka/releases), if it can't be reproduced on the latest version the issue has been fixed.
Checklist
IMPORTANT: We will close issues where the checklist has not been completed.
Please provide the following information:
var producer = new Kafka.Producer({ // 'debug' : 'all', 'client.id':'noderd-kafka', 'bootstrap.servers': 'lognlognhostname:9092', 'broker.version.fallback':'0.10.2.0', 'heartbeat.interval.ms':3000, 'compression.codec': 'none', 'request.required.acks':1, 'api.version.request':false, 'retry.backoff.ms': 200, 'message.send.max.retries': 10, 'socket.keepalive.enable': true, 'queue.buffering.max.messages': 10000, 'queue.buffering.max.ms': 1000, 'batch.num.messages': 10000, 'dr_cb': true },{ 'message.timeout.ms':300000, 'produce.offset.report':true, 'acks':1, 'offset.store.sync.interval.ms':10 });
Mac Os Mojave
The text was updated successfully, but these errors were encountered: