Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-16003] SerializationDebugger runs into infinite loop #13814

Closed
wants to merge 1 commit into from

Conversation

ericl
Copy link
Contributor

@ericl ericl commented Jun 21, 2016

What changes were proposed in this pull request?

This fixes SerializationDebugger to not recurse forever when writeReplace returns an object of the same class, which is the case for at least the SQLMetrics class.

See also the OpenJDK unit tests on the behavior of recursive writeReplace():
https://github.com/openjdk-mirror/jdk7u-jdk/blob/f4d80957e89a19a29bb9f9807d2a28351ed7f7df/test/java/io/Serializable/nestedReplace/NestedReplace.java

cc @davies @cloud-fan

How was this patch tested?

Unit tests for SerializationDebugger.

@SparkQA
Copy link

SparkQA commented Jun 21, 2016

Test build #60956 has finished for PR 13814 at commit 3237c27.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@cloud-fan
Copy link
Contributor

LGTM

@davies
Copy link
Contributor

davies commented Jun 22, 2016

What's the error message looks like in the case of unserializable object (for example, Iterator in scala 2.10)?

@andrewor14
Copy link
Contributor

LGTM

@ericl
Copy link
Contributor Author

ericl commented Jun 22, 2016

@davies the message looks ok to me:

Caused by: java.io.NotSerializableException: scala.collection.Iterator$$anon$13
Serialization stack:

    at org.apache.spark.serializer.SerializationDebugger$.improveException(SerializationDebugger.scala:40)
    at org.apache.spark.serializer.JavaSerializationStream.writeObject(JavaSerializer.scala:46)
    at org.apache.spark.serializer.JavaSerializerInstance.serialize(JavaSerializer.scala:100)
    at org.apache.spark.util.ClosureCleaner$.ensureSerializable(ClosureCleaner.scala:295)
    ... 44 more

@davies
Copy link
Contributor

davies commented Jun 22, 2016

Looks good, merging this into master and 2.0 branch.

asfgit pushed a commit that referenced this pull request Jun 22, 2016
## What changes were proposed in this pull request?

This fixes SerializationDebugger to not recurse forever when `writeReplace` returns an object of the same class, which is the case for at least the `SQLMetrics` class.

See also the OpenJDK unit tests on the behavior of recursive `writeReplace()`:
https://github.com/openjdk-mirror/jdk7u-jdk/blob/f4d80957e89a19a29bb9f9807d2a28351ed7f7df/test/java/io/Serializable/nestedReplace/NestedReplace.java

cc davies cloud-fan

## How was this patch tested?

Unit tests for SerializationDebugger.

Author: Eric Liang <ekl@databricks.com>

Closes #13814 from ericl/spark-16003.

(cherry picked from commit 6f915c9)
Signed-off-by: Davies Liu <davies.liu@gmail.com>
@asfgit asfgit closed this in 6f915c9 Jun 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants