Skip to content

Retry in w.Clusters.EnsureClusterIsRunning(id) when cluster is simultaneously started by two different processes#580

Merged
nfx merged 1 commit intomainfrom
fix/ensure-running
Aug 14, 2023
Merged

Retry in w.Clusters.EnsureClusterIsRunning(id) when cluster is simultaneously started by two different processes#580
nfx merged 1 commit intomainfrom
fix/ensure-running

Conversation

@nfx
Copy link
Copy Markdown
Contributor

@nfx nfx commented Aug 11, 2023

…ltaneously started by two different processes

This PR adds a retry for timing edge cases like `INVALID_STATE: Cluster XXX is in unexpected state Pending.`
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 11, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01% ⚠️

Comparison is base (5ef91cf) 18.25% compared to head (8ddb55b) 18.24%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #580      +/-   ##
==========================================
- Coverage   18.25%   18.24%   -0.01%     
==========================================
  Files          85       85              
  Lines        9861     9865       +4     
==========================================
  Hits         1800     1800              
- Misses       7906     7910       +4     
  Partials      155      155              
Files Changed Coverage Δ
service/compute/utilities.go 1.05% <0.00%> (-0.05%) ⬇️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Copy Markdown
Contributor

@mgyucht mgyucht left a comment

Choose a reason for hiding this comment

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

Small nit, otherwise LGTM

return retries.Wait(ctx, timeout, func() *retries.Err {
err := a.startClusterIfNeeded(ctx, clusterId, timeout)
var apiErr *apierr.APIError
if errors.As(err, &apiErr) && apiErr.ErrorCode == "INVALID_STATE" {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we define this error code as a constant?

@nfx nfx added this pull request to the merge queue Aug 14, 2023
Merged via the queue into main with commit 997cbc5 Aug 14, 2023
github-merge-queue bot pushed a commit to databricks/databricks-sdk-py that referenced this pull request Aug 16, 2023
…imultaneously started by two different processes. (#283)

This PR adds a retry for timing edge cases like `INVALID_STATE: Cluster
XXX is in unexpected state Pending.`

Other PRs:
- databricks/databricks-sdk-go#580
- databricks/databricks-sdk-java#134
github-merge-queue bot pushed a commit to databricks/databricks-sdk-java that referenced this pull request Aug 16, 2023
…multaneously started by two different processes (#134)

This PR adds a retry for timing edge cases like `INVALID_STATE: Cluster
XXX is in unexpected state Pending.`

Other PRs: 
- databricks/databricks-sdk-py#283
- databricks/databricks-sdk-go#580
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