Skip to content

Python: if the cluster is already starting up, just wait for it#461

Merged
benc-db merged 2 commits into
mainfrom
make_waiting_better
Sep 25, 2023
Merged

Python: if the cluster is already starting up, just wait for it#461
benc-db merged 2 commits into
mainfrom
make_waiting_better

Conversation

@benc-db
Copy link
Copy Markdown
Collaborator

@benc-db benc-db commented Sep 25, 2023

Description

This should fix the issue where multiple threads try to start the same cluster, and we get an exception saying the cluster is Pending.

Checklist

  • I have run this code in development and it appears to resolve the stated issue
  • This PR includes tests, or tests are not required/relevant for this PR
  • I have updated the CHANGELOG.md and added information about my change to the "dbt-databricks next" section.

susodapop
susodapop previously approved these changes Sep 25, 2023
Copy link
Copy Markdown

@susodapop susodapop left a comment

Choose a reason for hiding this comment

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

LGTM. This is just wrapping existing code so we can call it from a different place, yes?

@benc-db
Copy link
Copy Markdown
Collaborator Author

benc-db commented Sep 25, 2023

LGTM. This is just wrapping existing code so we can call it from a different place, yes?

It also changes the behavior if the cluster is already starting. If the cluster was already starting, we would get those pending exceptions. Now if the state isn't terminated or terminating, it waits until the state is running. This is important when running with multiple threads because one will start the cluster, then the next will see that its not terminated, so attempt to submit the job.

@benc-db benc-db force-pushed the make_waiting_better branch from 07bc2a6 to 31cdaaa Compare September 25, 2023 21:02
@benc-db benc-db temporarily deployed to azure-prod September 25, 2023 21:02 — with GitHub Actions Inactive
@benc-db benc-db temporarily deployed to azure-prod September 25, 2023 21:02 — with GitHub Actions Inactive
@benc-db benc-db temporarily deployed to azure-prod September 25, 2023 21:02 — with GitHub Actions Inactive
@benc-db benc-db merged commit 6a0772e into main Sep 25, 2023
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.

3 participants