Details
-
Bug
-
Status: Patch Available
-
Major
-
Resolution: Unresolved
-
1.4.0
-
None
-
None
-
Check if the reconnect to the source appender succeeded and rpcClient is not null to avoid a NullPointerException.
Description
If a client program is configured to use Log4J appender in unsafe mode and if the source was available when the client program started but became unavailable afterwards, Log4J appender can cause a NullPointerException. The stack trace is as follows.
2013-12-11 15:20:36,619 ERROR [STDERR] (Thread-23) Exception in thread "Thread-23"
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) java.lang.NullPointerException
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) at org.apache.flume.clients.log4jappender.Log4jAppender.append(Log4jAppender.java:163)
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) at org.apache.log4j.AppenderSkeleton.doAppend(AppenderSkeleton.java:230)
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) at org.apache.log4j.helpers.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:65)
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) at org.apache.log4j.Category.callAppenders(Category.java:203)
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) at org.apache.log4j.Category.forcedLog(Category.java:388)
2013-12-11 15:20:36,620 ERROR [STDERR] (Thread-23) at org.apache.log4j.Category.log(Category.java:853)
I have developed a fix that'll will address this problem. I'll attach the patch shortly.