Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Flume, mail # dev - Review Request 16215: Patch for FLUME-2186 - Log4jAppender throws a NPE when Flume is turned off


Copy link to this message
-
Re: Review Request 16215: Patch for FLUME-2186 - Log4jAppender throws a NPE when Flume is turned off
Ashish Paliwal 2013-12-13, 06:08

-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/16215/
-----------------------------------------------------------

(Updated Dec. 13, 2013, 6:08 a.m.)
Review request for Flume.
Changes
-------

Incorporated review comments from Hari. Added test case (testLog4jAppenderFailureUnsafeModeReconnect())
Bugs: FLUME-2186
    https://issues.apache.org/jira/browse/FLUME-2186
Repository: flume-git
Description
-------

Added null check for rpcClient before append().
Added activateOptions() code if unsafeMode is true, to reconnect.

Solution is not very clean as activateOptions() shall be called as many times as append() is called. In absence of this, reconnect cannot happen, as null check would succeed and return in append()
Diffs (updated)
-----

  flume-ng-clients/flume-ng-log4jappender/src/main/java/org/apache/flume/clients/log4jappender/Log4jAppender.java 7c483db
  flume-ng-clients/flume-ng-log4jappender/src/test/java/org/apache/flume/clients/log4jappender/TestLog4jAppender.java 1b840f3

Diff: https://reviews.apache.org/r/16215/diff/
Testing
-------

Test cases exist for the failure. Not added for this case, reference has to be null, after initial null check at the beginning of append(). Not sure of a clean way to do this.
Thanks,

Ashish Paliwal