flume-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dengkai (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (FLUME-3043) KafkaSink SinkCallback throws NullPointerException when Log4J level is debug
Date Wed, 29 Mar 2017 11:22:41 GMT

     [ https://issues.apache.org/jira/browse/FLUME-3043?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

dengkai updated FLUME-3043:
---------------------------
    Description: 
When we send a event with SinkCallback to kafka under DEBUG level of log4j, if kafka reponses
a result with exception but not a RecordMetadata. Kafka Sink will throw NPE.

code in SinkCallback:
{code}
if (logger.isDebugEnabled()) {
long eventElapsedTime = System.currentTimeMillis() - startTime;
logger.debug("Acked message partition:{} ofset:{}",  metadata.partition(), metadata.offset());
logger.debug("Elapsed time for send: {}", eventElapsedTime);
}
{code}

code in Kafka Producer:
{code}
if (exception == null) { 
RecordMetadata metadata = new RecordMetadata(...);
thunk.callback.onCompletion(metadata, null);
} else {
thunk.callback.onCompletion(null, exception);
}
{code}

  was:
When we send a event with SinkCallback to kafka under DEBUG level of log4j, if kafka reponses
a result with exception but not a RecordMetadata. Kafka Sink will throw NPE.

code in SinkCallback:
if (logger.isDebugEnabled()) {
long eventElapsedTime = System.currentTimeMillis() - startTime;
logger.debug("Acked message partition:{} ofset:{}",  metadata.partition(), metadata.offset());
logger.debug("Elapsed time for send: {}", eventElapsedTime);
}

code in Kafka Producer:
if (exception == null) { 
RecordMetadata metadata = new RecordMetadata(...);
thunk.callback.onCompletion(metadata, null);
} else {
thunk.callback.onCompletion(null, exception);
}



> KafkaSink SinkCallback throws NullPointerException when Log4J level is debug
> ----------------------------------------------------------------------------
>
>                 Key: FLUME-3043
>                 URL: https://issues.apache.org/jira/browse/FLUME-3043
>             Project: Flume
>          Issue Type: Bug
>          Components: Sinks+Sources
>    Affects Versions: 1.7.0
>            Reporter: dengkai
>            Assignee: dengkai
>         Attachments: FLUME-3043.patch
>
>
> When we send a event with SinkCallback to kafka under DEBUG level of log4j, if kafka
reponses a result with exception but not a RecordMetadata. Kafka Sink will throw NPE.
> code in SinkCallback:
> {code}
> if (logger.isDebugEnabled()) {
> long eventElapsedTime = System.currentTimeMillis() - startTime;
> logger.debug("Acked message partition:{} ofset:{}",  metadata.partition(), metadata.offset());
> logger.debug("Elapsed time for send: {}", eventElapsedTime);
> }
> {code}
> code in Kafka Producer:
> {code}
> if (exception == null) { 
> RecordMetadata metadata = new RecordMetadata(...);
> thunk.callback.onCompletion(metadata, null);
> } else {
> thunk.callback.onCompletion(null, exception);
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message