Repository: spark Updated Branches: refs/heads/branch-1.4 334824505 -> 77cb1d5ed
Revert "[SPARK-8498] [TUNGSTEN] fix npe in errorhandling path in unsafeshuffle writer" This reverts commit 33482450559028b907a0473277297cc54429322e. Reverting because `catch (Exception e) ... throw e` doesn't compile under Java 6 unless the method declares that it throws Exception. Project: http://git-wip-us.apache.org/repos/asf/spark/repo Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/77cb1d5e Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/77cb1d5e Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/77cb1d5e Branch: refs/heads/branch-1.4 Commit: 77cb1d5ed1d0343b512856e24d9c14556236364b Parents: 3348245 Author: Josh Rosen <joshro...@databricks.com> Authored: Tue Jun 23 09:19:11 2015 -0700 Committer: Josh Rosen <joshro...@databricks.com> Committed: Tue Jun 23 09:19:11 2015 -0700 ---------------------------------------------------------------------- .../spark/shuffle/unsafe/UnsafeShuffleWriter.java | 18 ++---------------- .../shuffle/unsafe/UnsafeShuffleWriterSuite.java | 17 ----------------- 2 files changed, 2 insertions(+), 33 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/spark/blob/77cb1d5e/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriter.java ---------------------------------------------------------------------- diff --git a/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriter.java b/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriter.java index 764578b..ad7eb04 100644 --- a/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriter.java +++ b/core/src/main/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriter.java @@ -139,9 +139,6 @@ public class UnsafeShuffleWriter<K, V> extends ShuffleWriter<K, V> { @Override public void write(scala.collection.Iterator<Product2<K, V>> records) throws IOException { - // Keep track of success so we know if we ecountered an exception - // We do this rather than a standard try/catch/re-throw to handle - // generic throwables. boolean success = false; try { while (records.hasNext()) { @@ -150,19 +147,8 @@ public class UnsafeShuffleWriter<K, V> extends ShuffleWriter<K, V> { closeAndWriteOutput(); success = true; } finally { - if (sorter != null) { - try { - sorter.cleanupAfterError(); - } catch (Exception e) { - // Only throw this error if we won't be masking another - // error. - if (success) { - throw e; - } else { - logger.error("In addition to a failure during writing, we failed during " + - "cleanup.", e); - } - } + if (!success) { + sorter.cleanupAfterError(); } } } http://git-wip-us.apache.org/repos/asf/spark/blob/77cb1d5e/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java ---------------------------------------------------------------------- diff --git a/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java b/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java index 10c3eed..83d1091 100644 --- a/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java +++ b/core/src/test/java/org/apache/spark/shuffle/unsafe/UnsafeShuffleWriterSuite.java @@ -253,23 +253,6 @@ public class UnsafeShuffleWriterSuite { createWriter(false).stop(false); } - class PandaException extends RuntimeException { - } - - @Test(expected=PandaException.class) - public void writeFailurePropagates() throws Exception { - class BadRecords extends scala.collection.AbstractIterator<Product2<Object, Object>> { - @Override public boolean hasNext() { - throw new PandaException(); - } - @Override public Product2<Object, Object> next() { - return null; - } - } - final UnsafeShuffleWriter<Object, Object> writer = createWriter(true); - writer.write(new BadRecords()); - } - @Test public void writeEmptyIterator() throws Exception { final UnsafeShuffleWriter<Object, Object> writer = createWriter(true); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org For additional commands, e-mail: commits-h...@spark.apache.org