-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
nginx worker processes exit with signal 11 when publishing messages in nginx #56
Comments
Can you provide a backtrace of the crash by running it in gdb? Are you really supposed to destroy me->kafka_handler in sendmsg_kafka()? I.e., is sendmsg only called once?
|
Based on your suggestion, I modify the sendmsg code below( by using gdb find a stupid mistake which make process exit, I have solved it). The new issue is nothing sent out with below code. Could you give more advise? int mercury_sendmsg_kafka(mercury_t *me, const char * topic, const char *msg)
} |
Could you print errno if rd_kafka_produce() fails?
also, try enabling rdkafka debugging by setting conf property "debug" to "all":
|
edenhill, |
edenhill, |
Can you check with the bin/kafka-topic.sh tool (official apache kafka package) that topic item.010001 exists? Can you provide more/all debugging output? |
As its weekend I will retest next Monday. Report here later |
There is no corresponding topic in kafka server. Restested then following error messages generated by nginx ( I thought they are from libkafka client): It seems that client can't get the leader partition. Alternative experiment: |
Do you have Can you provide some more debug log output? |
Creating a new kafka handle for each new connection in nginx seems kind of expensive since it will:
So there is at least B+N (B=bootstrap brokers, N=brokers) connections made and similar number of metadata requests before it will be able to start producing messages. After that your message will be sent to one of the brokers and it will wait for a reply (if request.required.acks is not 0). I dont know the internals of nginx, but would it be possible to share the kafka and topic handles between requests? |
Only the first record can be written to topic. [2014-01-14 17:06:54,232] INFO New leader is 2 (kafka.server.ZookeeperLeaderElector$LeaderChangeListener) In nginx logs ,there are still many 'has no partitions' for new coming topics, only the first record (with topic) can write rightly. see below: BTW, I use one nginx process to test for simplicity. Why the resting records can't get topic metadata? |
I modify my code for above test as follows:
} int mercury_add_kafkabroker(mercury_t *me, const char *kafka_brokers)
} |
Thanks for the extended debug info. It was fixed in 16915a2 In any case using the latest master is favourable. |
we use kafka_2.8.0-0.8.0 and librdkafka 0.8 version. which version should be ok? |
when using master code, after 'make' ,there is no *.so in current path. Errors in makefile? |
I would like you to try the master branch. Uhm, there should be .so files built. |
CentOS release 6.3 (Final) |
Thanks. And also preferably the output from: 'make clean all' |
Issue #61 regarding .so generation is now fixed |
Thanks for your patient, it can work now by using master branch. Thanks |
You should typically hold on to the rkt (rd_kafka_topic_t *) and reuse it for producing your messages, so I would store it with the rk pointer (rd_kafka_t *) in your own struct and then reuse it as necessary. |
Hi edenhill,
I write c code which called by lua to produce messages to kafka server . The lua code is called in nginx server.
I create one kafka handle and add a list of brokers once in nginx initialisation. Then when receiving requests to nginx server, call the lua code to publish messages.
But I got the nginx worker processes exit with signal 11 once requests sent out.
I also wonder if it's right to hold one kafka handle for dealing with all topic write effectively.
As I don't know how to attach the code,i past the major code snippt below:
//the code try to create one kafka handle and add brokers
int mercury_add_kafkabroker(mercury_t *me, const char *kafka_brokers)
{
}
//the code is called looply by receiving request to nginx server
int mercury_sendmsg_kafka(mercury_t *me, const char * topic, const char *msg)
{
if (!me || !msg) return -1;
}
Thanks
Aaron
The text was updated successfully, but these errors were encountered: