-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-44193][CONNECT] Implement GRPC exceptions interception for conversion #41743
Conversation
.../client/jvm/src/test/scala/org/apache/spark/sql/connect/client/SparkConnectClientSuite.scala
Show resolved
Hide resolved
...t/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/GrpcExceptionConverter.scala
Show resolved
Hide resolved
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/GrpcStub.scala
Outdated
Show resolved
Hide resolved
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/GrpcStub.scala
Outdated
Show resolved
Hide resolved
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.
TMLG (To me it looks good.)
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.
Please change the name.
connector/connect/client/jvm/src/main/scala/org/apache/spark/sql/connect/client/GrpcStub.scala
Outdated
Show resolved
Hide resolved
Followup: cc also @dillitz |
Yes, that's a good point. It would be nice to have similar (ideally the same) wrappers for both blocking and non-blocking stubs in ArtifactManager. |
I'd be in favor of also adding functions to SparkConnectClient that the ArtifactManager, so that every RPC goes through SparkConnectClient. |
Merged to master. |
…k Connect ### What changes were proposed in this pull request? This PR introduces a configurable retry mechanism for the Scala `SparkConnectClient`. Parameters for the exponential backoff and a filter for exceptions to retry are passed to the client via the existing (extended) `Configuration` class. By default, only RuntimeStatusException: Unavailable triggers a retry - this mirrors the default retry behavior in the Python client. One might want to move the retry logic into the GRPC stub that will potentially be introduced [here](#41743). ### Why are the changes needed? There are a few existing exceptions that one might want to handle with a retry. For example, this would allow one to not exit with an exception when executing a command while the cluster is still starting. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests included. Closes #41829 from dillitz/spark-44275-retries. Authored-by: Robert Dillitz <robert.dillitz@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
…version ### What changes were proposed in this pull request? This PR adds GrpcStub and GrpcExceptionConverter utilities to the Spark Connect Scala Client so that the client can intercept the GRPC Exceptions and convert them to Spark related exceptions. The change converts all GRPC RuntimeStatusException to SparkException as a starting point. ### Why are the changes needed? Intercept GRPC Exceptions in Spark Connect Scala Client and convert them to Spark related exceptions for making exceptions more compatible with the existing behaviors ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Existing tests Closes apache#41743 from heyihong/SPARK-42554. Authored-by: Yihong He <yihong.he@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
…k Connect ### What changes were proposed in this pull request? This PR introduces a configurable retry mechanism for the Scala `SparkConnectClient`. Parameters for the exponential backoff and a filter for exceptions to retry are passed to the client via the existing (extended) `Configuration` class. By default, only RuntimeStatusException: Unavailable triggers a retry - this mirrors the default retry behavior in the Python client. One might want to move the retry logic into the GRPC stub that will potentially be introduced [here](apache#41743). ### Why are the changes needed? There are a few existing exceptions that one might want to handle with a retry. For example, this would allow one to not exit with an exception when executing a command while the cluster is still starting. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Tests included. Closes apache#41829 from dillitz/spark-44275-retries. Authored-by: Robert Dillitz <robert.dillitz@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
What changes were proposed in this pull request?
This PR adds GrpcStub and GrpcExceptionConverter utilities to the Spark Connect Scala Client so that the client can intercept the GRPC Exceptions and convert them to Spark related exceptions. The change converts all GRPC RuntimeStatusException to SparkException as a starting point.
Why are the changes needed?
Intercept GRPC Exceptions in Spark Connect Scala Client and convert them to Spark related exceptions for making exceptions more compatible with the existing behaviors
Does this PR introduce any user-facing change?
No
How was this patch tested?
Existing tests