Skip to content

SOLR-18089: Configure zookeeper.maxCnxns for embeddedZkServer#4173

Open
openworld-maker wants to merge 1 commit intoapache:mainfrom
openworld-maker:codex/SOLR-18089-embedded-zk-maxcnxns
Open

SOLR-18089: Configure zookeeper.maxCnxns for embeddedZkServer#4173
openworld-maker wants to merge 1 commit intoapache:mainfrom
openworld-maker:codex/SOLR-18089-embedded-zk-maxcnxns

Conversation

@openworld-maker
Copy link

What

Fixes SOLR-18089 by explicitly configuring ZooKeeper's zookeeper.maxCnxns system property to 0 for embedded ZooKeeper startup when it is not already set.

Why

Embedded ZK startup emits:
"maxCnxns is not configured, using default value 0."

ZooKeeper uses zookeeper.maxCnxns with default 0. Setting it explicitly suppresses the warning while preserving behavior.

Changes

  • Added constants in SolrZkServer:
    • ZK_MAX_CNXNS_PROPERTY = "zookeeper.maxCnxns"
    • ZK_MAX_CNXNS_DEFAULT = "0"
  • Added ensureZkMaxCnxnsConfigured() and invoked it in:
    • SolrZkServer.start() before ZooKeeper startup
    • ZkTestServer.run(...) before server initialization in test framework
  • Guarded behavior: only sets property when currently unset (does not override user-provided value).

Tests

  • Added ZkTestServerTest#testEmbeddedZkServerSetsMaxCnxnsDefaultWhenUnset:
    • clears zookeeper.maxCnxns
    • starts embedded ZkTestServer
    • asserts property equals "0"
    • restores prior property value in finally

Verification

  • :solr:test-framework:test --tests org.apache.solr.cloud.ZkTestServerTest passed.
  • Full tidy check was attempted but hit unrelated flaky failures in solrj tests (CloudSolrClientCacheTest).
  • Ran equivalent focused validation for touched modules:
    • tidy
    • :solr:core:check -x test
    • :solr:test-framework:check -x test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants