Uploaded image for project: 'Flume'
  1. Flume
  2. FLUME-2271

Log4j appender source can cause NullPointerException even in Unsafe mode

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.4.0
    • None
    • Client SDK
    • 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.

      Attachments

        1. FLUME-2271.patch
          1 kB
          Mubashir Kazia

        Activity

          People

            Unassigned Unassigned
            mkazia Mubashir Kazia
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated: