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

Log4j appender source can cause NullPointerException even in Unsafe mode

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Patch Available
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.4.0
    • Fix Version/s: None
    • Component/s: Client SDK
    • Labels:
      None
    • Release Note:
      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

            • Assignee:
              Unassigned
              Reporter:
              mkazia Mubashir Kazia
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: