-
Notifications
You must be signed in to change notification settings - Fork 29k
SPARK-2893: Do not swallow Exceptions when running a custom kryo registrator #1827
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
Conversation
|
Can one of the admins verify this patch? |
|
Jenkins, test this please. |
|
Jenkins, retest this please. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This loses the stacktrace on exception e -- can we include that in the second parameter of the SparkException as the cause?
|
@GrahamDennis only people on the whitelist can trigger a jenkins test -- you need an admin to trigger this test for you and/or put you on the whitelist |
…o.registrator The previous behaviour of swallowing ClassNotFound exceptions when running a custom Kryo registrator could lead to difficult to debug problems later on at serialisation / deserialisation time, see SPARK-2878. Instead it is better to fail fast. Added test case.
|
Fixed the exception message. So that's why the tests weren't running -- Thanks @ash211! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo : nonexistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you change this to
// Allow the user to register their own classes by setting spark.kryo.registrator
for (regCls <- registrator) {
logDebug("Running user registrator: " + regCls)
try {
val reg = Class.forName(regCls, true, classLoader).newInstance()
.asInstanceOf[KryoRegistrator]
reg.registerClasses(kryo)
} catch {
case e: Exception =>
throw new SparkException(s"Failed to invoke $regCls", e)
}
}|
@rxin: I've made the change you've suggested, but as there can be at most one custom kryo registrator (the for loop is extracting the value from an option), I don't see how this really improves things? |
|
Because this way you get to log the class name :) |
|
Jenkins, test this please. |
|
will this fix back-ported to 1.0.1 ? I am getting these nondeterministic exceptions on both 1.0.1 and 1.1.0-SNAPSHOT.... |
|
QA tests have started for PR 1827. This patch merges cleanly. |
|
Yes, back to branch-1.0. (not 1.0.1 since we cannot change a released version, but we can push 1.0.3). |
|
branch-1.0 is fine as well.... |
|
QA results for PR 1827: |
|
I forgot to update the test case when I changed the exception message generated. Fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to update this error message now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the updated message. I beat you to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I've run this test locally, and it passes).
|
Jenkins, retest this please. |
|
QA tests have started for PR 1827. This patch merges cleanly. |
|
QA results for PR 1827: |
|
I think the test failure is not caused by this. Those two tests have been flaky. I'm going to merge this in master & branch-1.1 & branch-1.0. Thanks! |
…strator The previous behaviour of swallowing ClassNotFound exceptions when running a custom Kryo registrator could lead to difficult to debug problems later on at serialisation / deserialisation time, see SPARK-2878. Instead it is better to fail fast. Added test case. Author: Graham Dennis <[email protected]> Closes #1827 from GrahamDennis/feature/spark-2893 and squashes the following commits: fbe4cb6 [Graham Dennis] [SPARK-2878]: Update the test case to match the updated exception message 65e53c5 [Graham Dennis] [SPARK-2893]: Improve message when a spark.kryo.registrator fails. f480d85 [Graham Dennis] [SPARK-2893] Fix typo. b59d2c2 [Graham Dennis] SPARK-2893: Do not swallow Exceptions when running a custom spark.kryo.registrator (cherry picked from commit 6b8de0e) Signed-off-by: Reynold Xin <[email protected]>
…strator The previous behaviour of swallowing ClassNotFound exceptions when running a custom Kryo registrator could lead to difficult to debug problems later on at serialisation / deserialisation time, see SPARK-2878. Instead it is better to fail fast. Added test case. Author: Graham Dennis <[email protected]> Closes #1827 from GrahamDennis/feature/spark-2893 and squashes the following commits: fbe4cb6 [Graham Dennis] [SPARK-2878]: Update the test case to match the updated exception message 65e53c5 [Graham Dennis] [SPARK-2893]: Improve message when a spark.kryo.registrator fails. f480d85 [Graham Dennis] [SPARK-2893] Fix typo. b59d2c2 [Graham Dennis] SPARK-2893: Do not swallow Exceptions when running a custom spark.kryo.registrator (cherry picked from commit 6b8de0e) Signed-off-by: Reynold Xin <[email protected]>
|
Great, thanks! |
…strator The previous behaviour of swallowing ClassNotFound exceptions when running a custom Kryo registrator could lead to difficult to debug problems later on at serialisation / deserialisation time, see SPARK-2878. Instead it is better to fail fast. Added test case. Author: Graham Dennis <[email protected]> Closes apache#1827 from GrahamDennis/feature/spark-2893 and squashes the following commits: fbe4cb6 [Graham Dennis] [SPARK-2878]: Update the test case to match the updated exception message 65e53c5 [Graham Dennis] [SPARK-2893]: Improve message when a spark.kryo.registrator fails. f480d85 [Graham Dennis] [SPARK-2893] Fix typo. b59d2c2 [Graham Dennis] SPARK-2893: Do not swallow Exceptions when running a custom spark.kryo.registrator
The previous behaviour of swallowing ClassNotFound exceptions when running a custom Kryo registrator could lead to difficult to debug problems later on at serialisation / deserialisation time, see SPARK-2878. Instead it is better to fail fast.
Added test case.