Uh oh!
There was an error while loading. Please reload this page.
[SPARK-14454] Better exception handling while marking tasks as failed - #12234
[SPARK-14454] Better exception handling while marking tasks as failed#12234sameeragarwal wants to merge 2 commits into
Conversation
SparkQA
commented
Apr 7, 2016
Test build #55196 has finished for PR 12234 at commit
|
There was a problem hiding this comment.
so the thing is this exception doesn't make it to the driver. it would be great if the error message that made it to the driver can contain the error for both, and the original exception's cause. then users know there is another exception that failed during close/callback, and they can go look up in the executor for the full stacktrace
eebd2ef to
7964b2dCompareSparkQA
commented
Apr 7, 2016
Test build #55197 has finished for PR 12234 at commit
|
7964b2d to
94b37f2CompareSparkQA
commented
Apr 7, 2016
Test build #55198 has finished for PR 12234 at commit
|
94b37f2 to
c9aaff0Compare| * fail as well. This would then suppress the original/likely more meaningful | ||
| * exception from the original `out.write` call. | ||
| */ | ||
| def tryWithSafeCatchAndFailureCallbacks[T](block: => T)(catchBlock: => Unit): T = { |
There was a problem hiding this comment.
This seems redundant with the method above; they can be unified right?
There was a problem hiding this comment.
yes, thanks. folded these changes in the method above
SparkQA
commented
Apr 7, 2016
Test build #55199 has finished for PR 12234 at commit
|
sameeragarwal
commented
Apr 8, 2016
@davies are there other occurrences of this pattern? |
sameeragarwal
commented
Apr 8, 2016
test this please |
SparkQA
commented
Apr 8, 2016
Test build #55297 has finished for PR 12234 at commit
|
SparkQA
commented
Apr 8, 2016
Test build #55323 has finished for PR 12234 at commit
|
davies
commented
Apr 9, 2016
LGTM, |
rxin
commented
Apr 9, 2016
@sameeragarwal can you create one for 1.6 backport? |
…failed Backports #12234 to 1.6. Original description below: ## What changes were proposed in this pull request? This patch adds support for better handling of exceptions inside catch blocks if the code within the block throws an exception. For instance here is the code in a catch block before this change in `WriterContainer.scala`: ```scala logError("Aborting task.", cause) // call failure callbacks first, so we could have a chance to cleanup the writer. TaskContext.get().asInstanceOf[TaskContextImpl].markTaskFailed(cause) if (currentWriter != null) { currentWriter.close() } abortTask() throw new SparkException("Task failed while writing rows.", cause) ``` If `markTaskFailed` or `currentWriter.close` throws an exception, we currently lose the original cause. This PR fixes this problem by implementing a utility function `Utils.tryWithSafeCatch` that suppresses (`Throwable.addSuppressed`) the exception that are thrown within the catch block and rethrowing the original exception. ## How was this patch tested? No new functionality added Author: Sameer Agarwal <sameer@databricks.com> Closes#12272 from sameeragarwal/fix-exception-1.6.
…failed Backports apache#12234 to 1.6. Original description below: ## What changes were proposed in this pull request? This patch adds support for better handling of exceptions inside catch blocks if the code within the block throws an exception. For instance here is the code in a catch block before this change in `WriterContainer.scala`: ```scala logError("Aborting task.", cause) // call failure callbacks first, so we could have a chance to cleanup the writer. TaskContext.get().asInstanceOf[TaskContextImpl].markTaskFailed(cause) if (currentWriter != null) { currentWriter.close() } abortTask() throw new SparkException("Task failed while writing rows.", cause) ``` If `markTaskFailed` or `currentWriter.close` throws an exception, we currently lose the original cause. This PR fixes this problem by implementing a utility function `Utils.tryWithSafeCatch` that suppresses (`Throwable.addSuppressed`) the exception that are thrown within the catch block and rethrowing the original exception. ## How was this patch tested? No new functionality added Author: Sameer Agarwal <sameer@databricks.com> Closesapache#12272 from sameeragarwal/fix-exception-1.6. (cherry picked from commit c12db0d)
What changes were proposed in this pull request?
This patch adds support for better handling of exceptions inside catch blocks if the code within the block throws an exception. For instance here is the code in a catch block before this change in
WriterContainer.scala:If
markTaskFailedorcurrentWriter.closethrows an exception, we currently lose the original cause. This PR fixes this problem by implementing a utility functionUtils.tryWithSafeCatchthat suppresses (Throwable.addSuppressed) the exception that are thrown within the catch block and rethrowing the original exception.How was this patch tested?
No new functionality added