Keep stopped ClickHouse servers discoverable - #356
Open
sdairs wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Retains ClickHouse local-server metadata after a server stops so stopped instances remain discoverable in clickhousectl local server list, while clearing transient runtime details (PID/version/ports) for stopped ClickHouse entries and preventing connection helpers from using stopped metadata.
Changes:
- Preserve ClickHouse server metadata on stop/foreground-exit/failed-start and normalize stale PID metadata to a stopped sentinel (
pid: 0, cleared ports/version). - Hide ClickHouse version/ports in list output when stopped, and reject
local client/local server dotenvlookups against stopped entries. - Add subprocess regression tests covering stop/list normalization and stopped-connection failures; update README docs accordingly.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents retained identity metadata for stopped servers and listing behavior. |
| crates/clickhousectl/tests/local_server_stopped_test.rs | Adds subprocess regression coverage for stopped metadata retention/normalization and connection rejection. |
| crates/clickhousectl/src/local/server.rs | Introduces mark_server_stopped, keeps metadata on stop, and normalizes stale ClickHouse PIDs to “stopped”. |
| crates/clickhousectl/src/local/mod.rs | Rejects client/dotenv commands for stopped entries; suppresses ClickHouse runtime fields in list output when stopped; keeps metadata after foreground exit. |
| crates/clickhousectl/src/local/cli.rs | Updates CLI help text for list/stop/stop-all to reflect preserved metadata behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
sdairs
force-pushed
the
codex/issue-324-list-stopped-servers
branch
from
August 3, 2026 18:42
5d3bfe9 to
68db554
Compare
sdairs
force-pushed
the
codex/issue-324-list-stopped-servers
branch
from
August 3, 2026 19:34
68db554 to
9f4adcf
Compare
sdairs
force-pushed
the
codex/issue-324-list-stopped-servers
branch
from
August 3, 2026 20:04
9f4adcf to
8409efb
Compare
sdairs
marked this pull request as ready for review
August 3, 2026 20:25
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
pid: 0after clean stops, foreground exits, failed starts, and stale-process detectionStack
This PR is stacked on #355 and should be reviewed as the delta from
codex/issue-326-default-local-instance.Closes #324.
Validation
cargo fmt --all --checkcargo build -p clickhousectlcargo test -p clickhousectlcargo clippy -p clickhousectl --all-targets -- -D warnings