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

Tadhg Pearson commented on KAFKA-6207:
--------------------------------------

{quote} Why wouldn't your app just catch that specific exception and log the 
relevant info
{quote}
Absolutely. The problem before this issue was that exception did not include 
any relevant info to identify which message was too large, which leaves it 
impossible to troubleshoot for the user. However, I completely understand your 
concern regarding logging, and I see the current implementation forces logging 
of the message, which indeed could cause card numbers, passwords, etc. to get 
logged.

It suggest it would be better if the RecordTooLargeException carried the start 
of the message as a field in the object, rather than including it in the 
object's message field. This field should also not be included in the 
exception's toString function. This would render enough debugging information 
accessible to the caller if they choose to use it it, while keeping the 
implementation log-safe by default.

> Include start of record when RecordIsTooLarge
> ---------------------------------------------
>
>                 Key: KAFKA-6207
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6207
>             Project: Kafka
>          Issue Type: Bug
>          Components: producer 
>    Affects Versions: 0.10.1.1
>            Reporter: Tadhg Pearson
>            Priority: Minor
>
> When a message is too large to be sent (at 
> org.apache.kafka.clients.producer.KafkaProducer#doSend), the 
> RecordTooLargeException should carry the start of the record (for example, 
> the first 1KB) so that the calling application can debug which message caused 
> the error. 
> For example: one common use case of Kafka is logging. The 
> RecordTooLargeException is thrown due to a large log message being sent by 
> the application. How do you know which statement in your application logged 
> this large message? If your exception has thousands of logging statements, it 
> will be very tough to find which one is the cause today.... but you include 
> the start of the message, this could prove a very strong hint as to the cause!



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to