You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/19 10:52:26 UTC

[GitHub] [spark] bozhang2820 opened a new pull request, #37931: [WIP][SPARK-40488] Do not wrap exceptions thrown in FileFormatWriter.write with SparkException

bozhang2820 opened a new pull request, #37931:
URL: https://github.com/apache/spark/pull/37931

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: https://spark.apache.org/contributing.html
     2. Ensure you have added or run the appropriate tests for your PR: https://spark.apache.org/developer-tools.html
     3. If the PR is unfinished, add '[WIP]' in your PR title, e.g., '[WIP][SPARK-XXXX] Your PR title ...'.
     4. Be sure to keep the PR description updated to reflect all changes.
     5. Please write your PR title to summarize what this PR proposes.
     6. If possible, provide a concise example to reproduce the issue for a faster review.
     7. If you want to add a new configuration, please read the guideline first for naming configurations in
        'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
     8. If you want to add or modify an error type or message, please read the guideline first in
        'core/src/main/resources/error/README.md'.
   -->
   
   ### What changes were proposed in this pull request?
   Exceptions thrown in `FileFormatWriter.write` are wrapped with `SparkException("Job aborted.")`, which provides little extra information, but generates a long stacktrace and make the debugging process more difficult. 
   
   This change removes the wrapping.
   
   ### Why are the changes needed?
   This is to simplify the stacktrace when errors are thrown in `FileFormatWriter.write`.
   
   ### Does this PR introduce _any_ user-facing change?
   When exceptions are thrown in `FileFormatWriter.write`, the wrapping with `SparkException`s will be removed and stacktraces will be simplified.
   
   ### How was this patch tested?
   Existing tests.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on pull request #37931: [SPARK-40488] Do not wrap exceptions thrown when datasource write fails

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on PR #37931:
URL: https://github.com/apache/spark/pull/37931#issuecomment-1254985832

   thanks, merging to master!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] bozhang2820 commented on pull request #37931: [SPARK-40488] Do not wrap exceptions thrown when datasource write fails

Posted by GitBox <gi...@apache.org>.
bozhang2820 commented on PR #37931:
URL: https://github.com/apache/spark/pull/37931#issuecomment-1253098147

   @cloud-fan, could you take a look?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #37931: [SPARK-40488] Do not wrap exceptions thrown when datasource write fails

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #37931:
URL: https://github.com/apache/spark/pull/37931#discussion_r976048440


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/continuous/WriteToContinuousDataSourceExec.scala:
##########
@@ -65,14 +61,7 @@ case class WriteToContinuousDataSourceExec(write: StreamingWrite, query: SparkPl
     } catch {
       case _: InterruptedException =>
         // Interruption is how continuous queries are ended, so accept and ignore the exception.
-      case cause: Throwable =>
-        cause match {
-          // Do not wrap interruption exceptions that will be handled by streaming specially.
-          case _ if StreamExecution.isInterruptionException(cause, sparkContext) => throw cause
-          // Only wrap non fatal exceptions.
-          case NonFatal(e) => throw QueryExecutionErrors.writingJobAbortedError(e)
-          case _ => throw cause
-        }
+      case cause: Throwable => throw cause

Review Comment:
   since we can simply remove this line?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan closed pull request #37931: [SPARK-40488] Do not wrap exceptions thrown when datasource write fails

Posted by GitBox <gi...@apache.org>.
cloud-fan closed pull request #37931: [SPARK-40488] Do not wrap exceptions thrown when datasource write fails
URL: https://github.com/apache/spark/pull/37931


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


[GitHub] [spark] cloud-fan commented on a diff in pull request #37931: [SPARK-40488] Do not wrap exceptions thrown when datasource write fails

Posted by GitBox <gi...@apache.org>.
cloud-fan commented on code in PR #37931:
URL: https://github.com/apache/spark/pull/37931#discussion_r976048121


##########
core/src/test/scala/org/apache/spark/SparkThrowableSuite.scala:
##########
@@ -209,22 +209,6 @@ class SparkThrowableSuite extends SparkFunSuite {
     }
   }
 
-  test("Try catching SparkError with error class") {
-    try {
-      throw new SparkException(
-        errorClass = "WRITING_JOB_ABORTED",

Review Comment:
   we need to keep this test,  but with a different error class



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org