Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions solr/core/src/java/org/apache/solr/cloud/SolrZkServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ public class SolrZkServer {
private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());

public static final String ZK_WHITELIST_PROPERTY = "zookeeper.4lw.commands.whitelist";
public static final String ZK_MAX_CNXNS_PROPERTY = "zookeeper.maxCnxns";
// Per ZooKeeper, "0" means no limit for max client connections.
public static final String ZK_MAX_CNXNS_DEFAULT = "0";
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.

Comment what this value semantically means. Infinite?


boolean zkRun = false;
String zkHost;
Expand Down Expand Up @@ -138,6 +141,7 @@ public void start() {
return;
}

ensureZkMaxCnxnsConfigured();
if (System.getProperty(ZK_WHITELIST_PROPERTY) == null) {
System.setProperty(ZK_WHITELIST_PROPERTY, "ruok, mntr, conf");
}
Expand Down Expand Up @@ -208,6 +212,10 @@ public void stop() {
}
zkThread.interrupt();
}

static void ensureZkMaxCnxnsConfigured() {
System.getProperties().putIfAbsent(ZK_MAX_CNXNS_PROPERTY, ZK_MAX_CNXNS_DEFAULT);
}
}

// Allows us to set a default for the data dir before parsing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ public void run() throws InterruptedException, IOException {

public void run(boolean solrFormat) throws InterruptedException, IOException {
log.info("STARTING ZK TEST SERVER");
SolrZkServer.ensureZkMaxCnxnsConfigured();
ensureStatCommandWhitelisted();

AtomicReference<Throwable> zooError = new AtomicReference<>();
Expand Down
Loading