-
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-48056][CONNECT][PYTHON] Re-execute plan if a SESSION_NOT_FOUND error is raised and no partial response was received #46297
Conversation
8e5c921
to
15d332f
Compare
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.
@juliuszsompolski - this will be followed up in a separate PR |
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.
I don't have a problem with adding the dependency, but we should make sure that it's only needed for testing and documented in the requirements file as such.
Merged to master. |
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.
Hi, @nija-at , @grundprinzip, @juliuszsompolski , @HyukjinKwon .
I made a follow-up to fix Python 3.12 issue. assertEquals
is removed at Python 3.12.
This seems to be missed in another PR too. Maybe, we had better find a way to prevent this. |
…f `assertEquals` for Python 3.12 ### What changes were proposed in this pull request? This is a follow-up of - #46297 This PR aims to use `assertEqual` instead of `assertEquals` for Python 3.12. ### Why are the changes needed? To recover Python CI, - https://github.com/apache/spark/actions/workflows/build_python.yml From Python 3.12, `assertEquals` doesn't exist. https://docs.python.org/3/library/unittest.html#assert-methods ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46377 from dongjoon-hyun/SPARK-48056. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
Thanks for fixing |
… error is raised and no partial response was received ### What changes were proposed in this pull request? Similar to OPERATION_NOT_FOUND, re-attempt to execute the original spark connect plan when a SESSION_NOT_FOUND is received from the spark connect service and no partial responses were previously received. ### Why are the changes needed? This error has been noticed to occur during a cluster cold start and when a request arrives when the connect service is not fully initialized. ### Does this PR introduce _any_ user-facing change? Prevoiusly, connect-based pyspark APIs would fail with the error code "INVALID_HANDLE.SESSION_NOT_FOUND" in the very first request to the service. With this change, the client will now automatically retry. ### How was this patch tested? Attached unit tests. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#46297 from nija-at/session-not-found. Authored-by: Niranjan Jayakar <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
…f `assertEquals` for Python 3.12 ### What changes were proposed in this pull request? This is a follow-up of - apache#46297 This PR aims to use `assertEqual` instead of `assertEquals` for Python 3.12. ### Why are the changes needed? To recover Python CI, - https://github.com/apache/spark/actions/workflows/build_python.yml From Python 3.12, `assertEquals` doesn't exist. https://docs.python.org/3/library/unittest.html#assert-methods ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#46377 from dongjoon-hyun/SPARK-48056. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
@juliuszsompolski I just uploaded a scala version of it: #46971, could you review this? |
…ESSION_NOT_FOUND error is raised and no partial response was received ### What changes were proposed in this pull request? This change lets a Scala Spark Connect client reattempt execution of a plan when it receives a SESSION_NOT_FOUND error from the Spark Connect service if it has not received any partial responses. This is a Scala version of the previous fix of the same issue - #46297. ### Why are the changes needed? Spark Connect clients often get a spurious error from the Spark Connect service if the service is busy or the network is congested. This error leads to a situation where the client immediately attempts to reattach without the service being aware of the client; this leads to a query failure. ### Does this PR introduce _any_ user-facing change? Prevoiusly, a Scala Spark Connect client would fail with the error code "INVALID_HANDLE.SESSION_NOT_FOUND" in the very first attempt to make a request to the service, but with this change, the client will automatically retry. ### How was this patch tested? Attached unit test. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #46971 from changgyoopark-db/SPARK-48056. Authored-by: Changgyoo Park <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
What changes were proposed in this pull request?
Similar to OPERATION_NOT_FOUND, re-attempt to execute
the original spark connect plan when a SESSION_NOT_FOUND is
received from the spark connect service and no partial responses
were previously received.
Why are the changes needed?
This error has been noticed to occur during a cluster cold start
and when a request arrives when the connect service is not fully
initialized.
Does this PR introduce any user-facing change?
Prevoiusly, connect-based pyspark APIs would fail with the error code
"INVALID_HANDLE.SESSION_NOT_FOUND" in the very first request to
the service.
With this change, the client will now automatically retry.
How was this patch tested?
Attached unit tests.
Was this patch authored or co-authored using generative AI tooling?
No.