[
https://issues.apache.org/jira/browse/SOLR-3865?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Karel Vervaeke updated SOLR-3865:
---------------------------------
Description:
The problem lies in this bit of code:
{noformat}
public void connect() {
if (zkStateReader == null) {
synchronized (this) {
if (zkStateReader == null) {
try {
ZkStateReader zk = new ZkStateReader(zkHost, zkConnectTimeout,
zkClientTimeout);
zk.createClusterStateWatchersAndUpdate();
zkStateReader = zk;
} catch (InterruptedException e) {
{noformat}
When the zkHost is something like "localhost:2181/solr" but /solr doesn't exist
in solr you get a KeeperException$NoNodeException.
Unfortunately at this point the ZkStateReader has already been created,
and it's never assigned to zkStateReader so it's never closed, and somewhere
along the way a zookeeper thread is leaked (verified using jstack {PID}|grep
EventThread).
The solution would be to try zk.close() when there was an exception before you
reach the line "zkStateReader = zk"
> CloudSolrConnector connection leak when using wrong zk connection string
> ------------------------------------------------------------------------
>
> Key: SOLR-3865
> URL: https://issues.apache.org/jira/browse/SOLR-3865
> Project: Solr
> Issue Type: Bug
> Reporter: Karel Vervaeke
>
> The problem lies in this bit of code:
> {noformat}
> public void connect() {
> if (zkStateReader == null) {
> synchronized (this) {
> if (zkStateReader == null) {
> try {
> ZkStateReader zk = new ZkStateReader(zkHost, zkConnectTimeout,
> zkClientTimeout);
> zk.createClusterStateWatchersAndUpdate();
> zkStateReader = zk;
> } catch (InterruptedException e) {
> {noformat}
> When the zkHost is something like "localhost:2181/solr" but /solr doesn't
> exist in solr you get a KeeperException$NoNodeException.
> Unfortunately at this point the ZkStateReader has already been created,
> and it's never assigned to zkStateReader so it's never closed, and somewhere
> along the way a zookeeper thread is leaked (verified using jstack {PID}|grep
> EventThread).
> The solution would be to try zk.close() when there was an exception before
> you reach the line "zkStateReader = zk"
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]