eason-yuchen-liu commented on code in PR #59276:
URL: https://github.com/apache/spark/pull/59276#discussion_r4236211191
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/streaming/runtime/StreamExecution.scala:
##########
@@ -376,22 +376,33 @@ abstract class StreamExecution(
e
}
- streamDeathCause = new StreamingQueryException(
- toDebugString(includeLogicalPlan = isInitialized),
- cause = cause,
- getLatestExecutionContext().startOffsets
- .toOffsets(sources.toSeq, sourceToIdMap.map(_.swap),
- getLatestExecutionContext().offsetSeqMetadata)
- .toString,
- getLatestExecutionContext().endOffsets
- .toOffsets(sources.toSeq, sourceToIdMap.map(_.swap),
- getLatestExecutionContext().offsetSeqMetadata)
- .toString,
- errorClass = "STREAM_FAILED",
- messageParameters = Map(
- "id" -> id.toString,
- "runId" -> runId.toString,
- "message" -> message))
+ try {
+ streamDeathCause = new StreamingQueryException(
Review Comment:
A helper that just returns the exception can't keep the same behavior. On a
fatal build failure (e.g. `StackOverflowError`) we need to both set
`streamDeathCause` to the fallback and rethrow the error to the
`UncaughtExceptionHandler`, like the fatal `cause` below. A function can either
return a value or throw, not both, so the assignment has to happen before the
rethrow, inside the try/catch.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]