Yeah, see SOLR-4044 for more details. In that issue the client code was modified to throw a more useful exception if the cluster is not ready and it can also take an optional timeout parameter to wait for essential zk nodes to be created by the cluster.
One suggestion was to have the client create those nodes automatically but the general consensus was that clients should be read-only w.r.t. ZooKeeper. On Tue, Mar 24, 2015 at 9:26 AM, Shai Erera <ser...@gmail.com> wrote: > Hi > > If I init a CloudSolrClient on a fresh new cluster, no Solr nodes up yet, > and I call .connect(), I get an error that ZkStateReader can't read > /live_nodes (as this node doesn't yet exist). > > I do this from a unit test, and I know I don't need to call .connect() > (it's documented as optional), but wanted to ask -- is it wrong for > ZkStateReader.createClusterStateWatchersAndUpdate() to ensure /live_nodes > exists before it calls getChildren() and registers a watcher on it? > > The reason why I call .connect() is because I want to get a hold of the > ZkStateReader and use it in the unit test, to query the cluster state. > Perhaps I shouldn't? > > Shai > > -- Regards, Shalin Shekhar Mangar.