Author: nigel Date: Fri Oct 12 14:07:50 2007 New Revision: 584273 URL: http://svn.apache.org/viewvc?rev=584273&view=rev Log: HADOOP-1771. Fix a NullPointerException in streaming caused by an IOException in MROutputThread. Contributed by lohit.
Modified: lucene/hadoop/trunk/CHANGES.txt lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java Modified: lucene/hadoop/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/CHANGES.txt?rev=584273&r1=584272&r2=584273&view=diff ============================================================================== --- lucene/hadoop/trunk/CHANGES.txt (original) +++ lucene/hadoop/trunk/CHANGES.txt Fri Oct 12 14:07:50 2007 @@ -291,6 +291,9 @@ remain in the RUNNING state even after being killed by the JobTracker and thus handicap the cleanup of the task's output sub-directory. (acmurthy) + HADOOP-1771. Fix a NullPointerException in streaming caused by an + IOException in MROutputThread. (lohit vijayarenu via nigel) + IMPROVEMENTS HADOOP-1908. Restructure data node code so that block sending and Modified: lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java?rev=584273&r1=584272&r2=584273&view=diff ============================================================================== --- lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java (original) +++ lucene/hadoop/trunk/src/contrib/streaming/src/java/org/apache/hadoop/streaming/PipeMapRed.java Fri Oct 12 14:07:50 2007 @@ -353,13 +353,23 @@ logflush(); } } - } catch (IOException io) { - io.printStackTrace(log_); - outerrThreadsThrowable = io; + if (clientIn_ != null) { + clientIn_.close(); + clientIn_ = null; + LOG.info("MROutputThread done"); + } } catch (Throwable th) { outerrThreadsThrowable = th; + LOG.warn(StringUtils.stringifyException(th)); + try { + if (clientIn_ != null) { + clientIn_.close(); + clientIn_ = null; + } + } catch (IOException io) { + LOG.info(StringUtils.stringifyException(io)); + } } - logprintln("MROutputThread done"); } OutputCollector output; @@ -388,11 +398,22 @@ reporter.progress(); } } - } catch (IOException io) { - logStackTrace(io); - outerrThreadsThrowable = io; + if (clientErr_ != null) { + clientErr_.close(); + clientErr_ = null; + LOG.info("MRErrorThread done"); + } } catch (Throwable th) { outerrThreadsThrowable = th; + LOG.warn(StringUtils.stringifyException(th)); + try { + if (clientErr_ != null) { + clientErr_.close(); + clientErr_ = null; + } + } catch (IOException io) { + LOG.info(StringUtils.stringifyException(io)); + } } } long lastStderrReport = 0;