Skip to content

Prevent error when starting an already running cluster #2947

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

piyush-ahuja
Copy link

The databricks clusters start command returns an error if the target cluster is already in a RUNNING state, contrary to the help documentation, which states "If the cluster is not currently in a TERMINATED state, nothing will happen."

My code for this commit modifies the command to first check the cluster's state and if it is already RUNNING, prints to console (e.g., "Cluster <cluster_id> is already running.") and exits gracefully (status code 0).

I've added an integration test to verify this behavior (an absolute cliche, but worked on my local for me) to ensure a cluster is in a RUNNING state and then attempts to start it, checking for the correct output message and a successful exit code.

FYI: I did a deep dive of the repo, then created documentation to understand deeply on deepwiki.org & finally leveraged Cline + Claude, and Google Jules for test case generation + verification (apologies, not always 100% sure about edge cases and thought to AI-augment my PR) to ensure I actually got it right. Let me know if this strategy is acceptable, else reject the PR and I'll create another to fix what all I missed.

The `databricks clusters start` command would previously return an error
if the target cluster was already in a RUNNING state. This was contrary
to the help documentation, which states "If the cluster is not currently
in a TERMINATED state, nothing will happen."

This commit modifies the command to first check the cluster's state.
If the cluster is already RUNNING, it now prints a message to the console
(e.g., "Cluster <cluster_id> is already running.") and exits gracefully
with a status code of 0.

An integration test has been added to verify this behavior. The test
ensures a cluster is in a RUNNING state and then attempts to start it,
checking for the correct output message and a successful exit code.
Copy link

An authorized user can trigger integration tests manually by following the instructions below:

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 2947
  • Commit SHA: 8df7c2e04c29c8c1c007d068f4957b74c363c9c6

Checks will be approved automatically on success.

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.

1 participant