grundprinzip commented on code in PR #38720:
URL: https://github.com/apache/spark/pull/38720#discussion_r1027137884
##########
connector/connect/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectStreamHandler.scala:
##########
@@ -196,13 +196,14 @@ class SparkConnectStreamHandler(responseObserver:
StreamObserver[ExecutePlanResp
signal.wait()
result = partitions.remove(currentPartitionId)
}
- error match {
- case NonFatal(e) =>
- responseObserver.onError(error)
- logError("Error while processing query.", e)
- return
- case fatal: Throwable => throw fatal
- case null => result.get
+ if (error == null) {
+ result.get
+ } else if (NonFatal(error)) {
+ responseObserver.onError(error)
+ logError("Error while processing query.", error)
Review Comment:
In theory, logging first then responding might be better in case something
goes wrong and onError would throw.
--
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]