Skip to content
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

fix: terminate s8s session on kernel termination #24

Merged
merged 5 commits into from
Jan 24, 2025

Conversation

isha97
Copy link
Member

@isha97 isha97 commented Jan 22, 2025

No description provided.

@isha97 isha97 requested review from bsidhom, medb and ojarjur January 22, 2025 19:01
google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
Comment on lines 546 to 547
if state is not None and state == Session.State.FAILED:
raise RuntimeError("Serverless session termination failed")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this logic with the state = None statement above, put a return statement outside of the while loop on line 540, and then make the subsequent raise RuntimeError... call below unconditional.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to raise RuntimeError when state == Session.State.FAILED. After the while loop if the state is failed, we need to raise this error.

google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
Copy link
Contributor

@bsidhom bsidhom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after one small change.

google/cloud/spark_connect/session.py Outdated Show resolved Hide resolved
@isha97 isha97 merged commit beeaa98 into GoogleCloudDataproc:main Jan 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants