Skip to content

Fix clusters start for already active clusters#5538

Open
nanookclaw wants to merge 1 commit into
databricks:mainfrom
nanookclaw:fix/clusters-start-running-noop
Open

Fix clusters start for already active clusters#5538
nanookclaw wants to merge 1 commit into
databricks:mainfrom
nanookclaw:fix/clusters-start-running-noop

Conversation

@nanookclaw

Copy link
Copy Markdown

Why

databricks clusters start documents that non-TERMINATED clusters are a no-op, but the generated command forwards the backend INVALID_STATE error returned for already-running clusters. This makes retry/idempotent start flows fail even when the cluster is already in a usable state.

Changes

This adds a startOverrides hook for the generated workspace clusters command. The generated start path still runs first, preserving normal argument parsing, request handling, waiting, and rendering. If that call returns HTTP 400 INVALID_STATE, the override fetches the live cluster and returns success only when the cluster is confirmed non-TERMINATED and not a job cluster. If the follow-up fetch fails, the cluster is still terminated, or the target is a job cluster, the original error is returned.

Focused unit tests cover the already-running no-op case, normal start behavior with --no-wait, preserving errors for terminated clusters, preserving errors when the follow-up get fails, and preserving the documented job-cluster error.

Test plan

  • go test ./cmd/workspace/clusters
  • ./task fmt-q
  • ./task lint-q

Fixes #1372

@github-actions

Copy link
Copy Markdown
Contributor

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

Trigger:
go/deco-tests-run/cli

Inputs:

  • PR number: 5538
  • Commit SHA: a4f6056144d121589db28bbdf8e890ed70ba0959

Checks will be approved automatically on success.

@github-actions

Copy link
Copy Markdown
Contributor

Waiting for approval

Based on git history, these people are best suited to review:

  • @pietern -- recent work in cmd/workspace/clusters/

Eligible reviewers: @andrewnester, @anton-107, @denik, @renaudhartert-db, @shreyas-goenka, @simonfaltum

Suggestions based on git history. See OWNERS for ownership rules.

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.

databricks clusters start fails if cluster is already running, despite documentation to the contrary

1 participant