Retry newly provisioned Query API endpoints until ready - #504
Open
sdairs wants to merge 1 commit into
Open
Conversation
| let mut waiting = false; | ||
|
|
||
| loop { | ||
| let result = run_basic_service_query( |
There was a problem hiding this comment.
🟡 Medium cloud/services.rs:1768
A single run_basic_service_query(...).await can block past QUERY_ENDPOINT_READY_TIMEOUT indefinitely, so a newly provisioned endpoint that accepts a connection but never completes its response leaves the command hung. The deadline is checked only after each attempt returns; wrap each attempt in tokio::time::timeout using the remaining duration and return a timeout error when it expires.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @crates/clickhousectl/src/cloud/services.rs around line 1768:
A single `run_basic_service_query(...).await` can block past `QUERY_ENDPOINT_READY_TIMEOUT` indefinitely, so a newly provisioned endpoint that accepts a connection but never completes its response leaves the command hung. The deadline is checked only after each attempt returns; wrap each attempt in `tokio::time::timeout` using the remaining duration and return a timeout error when it expires.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #453
Tests
cargo test -p clickhousectl(748 passed)cargo test -p clickhousectl --test cli_request_shape_test service_query_retries_new_endpoint_readiness_without_reprovisioning -- --exact(1 passed)cargo fmt --all --checkcargo clippy -p clickhousectl --all-targets -- -D warningsNo live Cloud resources or credentials were used.
Stack
This is the child of
issue-451-query-provision-singleflight(PR #493). It targets that parent branch; PR #493 remains unchanged and should merge first.