You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by rx...@apache.org on 2015/04/28 09:38:18 UTC
spark git commit: [SPARK-7187] SerializationDebugger should not crash
user code
Repository: spark
Updated Branches:
refs/heads/master 9e4e82b7b -> bf35edd9d
[SPARK-7187] SerializationDebugger should not crash user code
rxin
Author: Andrew Or <an...@databricks.com>
Closes #5734 from andrewor14/ser-deb and squashes the following commits:
e8aad6c [Andrew Or] NonFatal
57d0ef4 [Andrew Or] try catch improveException
Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/bf35edd9
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/bf35edd9
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/bf35edd9
Branch: refs/heads/master
Commit: bf35edd9d4b8b11df9f47b6ff43831bc95f06322
Parents: 9e4e82b
Author: Andrew Or <an...@databricks.com>
Authored: Tue Apr 28 00:38:14 2015 -0700
Committer: Reynold Xin <rx...@databricks.com>
Committed: Tue Apr 28 00:38:14 2015 -0700
----------------------------------------------------------------------
.../apache/spark/serializer/SerializationDebugger.scala | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/spark/blob/bf35edd9/core/src/main/scala/org/apache/spark/serializer/SerializationDebugger.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/org/apache/spark/serializer/SerializationDebugger.scala b/core/src/main/scala/org/apache/spark/serializer/SerializationDebugger.scala
index cecb992..5abfa46 100644
--- a/core/src/main/scala/org/apache/spark/serializer/SerializationDebugger.scala
+++ b/core/src/main/scala/org/apache/spark/serializer/SerializationDebugger.scala
@@ -23,6 +23,7 @@ import java.security.AccessController
import scala.annotation.tailrec
import scala.collection.mutable
+import scala.util.control.NonFatal
import org.apache.spark.Logging
@@ -35,8 +36,15 @@ private[serializer] object SerializationDebugger extends Logging {
*/
def improveException(obj: Any, e: NotSerializableException): NotSerializableException = {
if (enableDebugging && reflect != null) {
- new NotSerializableException(
- e.getMessage + "\nSerialization stack:\n" + find(obj).map("\t- " + _).mkString("\n"))
+ try {
+ new NotSerializableException(
+ e.getMessage + "\nSerialization stack:\n" + find(obj).map("\t- " + _).mkString("\n"))
+ } catch {
+ case NonFatal(t) =>
+ // Fall back to old exception
+ logWarning("Exception in serialization debugger", t)
+ e
+ }
} else {
e
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org