epugh opened a new pull request, #4955: URL: https://github.com/apache/solr/pull/4955
## Summary Spun out of review discussion on a `bin/solr create` refactor (SOLR-18320): CLI commands that construct a `SolrClient` via `CLIUtils.getSolrClient` (or by hand-building an `HttpJettySolrClient.Builder`) currently inherit `SolrHttpConstants`' defaults — 60s connect / 600s idle. Those defaults are deliberately generous because they're shared by every SolrJ use case, including bulk indexing, shard-to-shard fan-out, and replica recovery, where a single request can legitimately take minutes. A human running a `bin/solr` command at a terminal wants the opposite: fail fast against an unreachable or hung node. `DeleteTool` already carried its own 15s/30s override for exactly this reason (and `CreateTool` used to, before a recent refactor accidentally dropped it by switching to the shared client builder). This PR centralizes that override: - Adds `CLIUtils.CLI_CONNECTION_TIMEOUT_SECONDS` (15) and `CLIUtils.CLI_IDLE_TIMEOUT_SECONDS` (30). - Applies them in `CLIUtils.getSolrClient`'s core builder and in `CLIUtils.solrUrlFromConnection`'s builder, which covers every CLI tool that calls `getSolrClient` (Healthcheck, SnapshotExport, Version, Assert, Export, Config, Create, Api, Delete, SnapshotList, Package, RunExample, Status, SnapshotCreate, SnapshotDelete). - Applies the same constants to the handful of tools that bypass `CLIUtils.getSolrClient` and hand-build their own `HttpJettySolrClient.Builder`: `DeleteTool` (replacing its hardcoded 15/30 with the shared constants), `HealthcheckTool`, `ExportTool`, `PostLogsTool`, `StreamTool`. Out of scope: `RunExampleTool`'s two internal `waitToSeeLiveNodes`/example-bootstrap `CloudSolrClient` builds are left on the long defaults — those are local-example node-readiness polling loops with their own retry/backoff logic, not a user-facing connection attempt, so a short connect timeout there wouldn't offer the same benefit and risks interacting oddly with the poll loop. ## Test plan - [x] `./gradlew :solr:core:compileJava` — compiles cleanly - [x] `./gradlew :solr:core:test --tests DeleteToolTest --tests TestExportTool --tests StreamToolTest --tests CreateToolTest --tests HealthcheckToolTest --tests PostLogsToolTest` — all pass (32 tests, 1 skipped) - [x] Added a changelog fragment under `changelog/unreleased/` 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01HaP4sXv7KQBw9ZEqtvwug2 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
