[ 
https://issues.apache.org/jira/browse/KAFKA-3334?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15216345#comment-15216345
 ] 

Ashish K Singh commented on KAFKA-3334:
---------------------------------------

[~becket_qin] thanks for the quick review. I think there are always two 
categories of users, naive users who do not want to deal with complexities of 
Kafka internals and pro users who know the details of Kafka. Almost always 
users start with very basic information and then with time they tend to get 
well aware of Kafka's expected behavior and how to get it to work. 
Documentations/ tutorials are of utmost importance to these new users. If we 
specify great deal of information in exceptions, it will still be puzzling to 
users as it happens when they hit the issue. IMHO, exceptions are not the best 
of communicating known potential issues to users. The exceptions in first few 
messages with auto topic creation comes as an issue/question users just once, 
once they know the reason, they never ask the same question again. Quite often 
we get response to such explanations as, "why is this not doc'd". To me, it 
will better to provide this information in the doc, but I can be convinced 
otherwise. Should we put in ops or in faq, and what exactly to put is up for 
debate. Also, I do not think we should be providing info on including how the 
internals work, rather just provide info on what users might see and how they 
can avoid it if it happens. [~ijuma] [~salex89] what do you guys suggest.

> First message on new topic not actually being sent, no exception thrown
> -----------------------------------------------------------------------
>
>                 Key: KAFKA-3334
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3334
>             Project: Kafka
>          Issue Type: Bug
>    Affects Versions: 0.9.0.0
>         Environment: Linux, Java
>            Reporter: Aleksandar Stojadinovic
>            Assignee: Ashish K Singh
>             Fix For: 0.10.1.0
>
>
> Although I've seen this issue pop around the internet in a few forms, I'm not 
> sure it is yet properly fixed. 
> When publishing to a new topic, with auto create-enabled, the java client 
> (0.9.0) shows this WARN message in the log, and the message is not sent 
> obviously:
> org.apache.kafka.clients.NetworkClient - Error while fetching metadata with 
> correlation id 0 : {file.topic=LEADER_NOT_AVAILABLE}
> In the meantime I see in the console the message that a log for partition is 
> created. The next messages are patched through normally, but the first one is 
> never sent. No exception is ever thrown, either by calling get on the future, 
> or with the async usage, like everything is perfect.
> I notice when I leave my application blocked on the get call, in the 
> debugger, then the message may be processed, but with significant delay. This 
> is consistent with another issue I found for the python client. Also, if I 
> call partitionsFor previously, the topic is created and the message is sent. 
> But it seems silly to call it every time, just to mitigate this issue.
> {code}
> Future<RecordMetadata> recordMetadataFuture = producer.send(new 
> ProducerRecord<>(topic, key, file));
>             RecordMetadata recordMetadata = recordMetadataFuture.get(30, 
> TimeUnit.SECONDS);
> {code}
> I hope I'm clear enough.
> Related similar (but not same) issues:
> https://issues.apache.org/jira/browse/KAFKA-1124
> https://github.com/dpkp/kafka-python/issues/150
> http://stackoverflow.com/questions/35187933/how-to-resolve-leader-not-available-kafka-error-when-trying-to-consume



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to