Solr
  1. Solr
  2. SOLR-5678

When SolrJ/SolrCloud can't talk to Zookeeper, it throws a RuntimeException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.6
    • Fix Version/s: 4.7, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      This class of exception should not be used for run-of-the-mill networking kinds of issues. SolrServerException or some variety of IOException should be thrown instead. Here's the trace:

      java.lang.RuntimeException: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper localhost:2181 within 60000 ms
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:130)
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:88)
      	at org.apache.solr.common.cloud.ZkStateReader.<init>(ZkStateReader.java:148)
      	at org.apache.solr.client.solrj.impl.CloudSolrServer.connect(CloudSolrServer.java:147)
      	at org.apache.solr.client.solrj.impl.CloudSolrServer.request(CloudSolrServer.java:173)
      	at org.apache.manifoldcf.agents.output.solr.HttpPoster$SolrPing.process(HttpPoster.java:1315)
      	at org.apache.manifoldcf.agents.output.solr.HttpPoster$StatusThread.run(HttpPoster.java:1208)
      Caused by: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper localhost:2181 within 60000 ms
      	at org.apache.solr.common.cloud.ConnectionManager.waitForConnected(ConnectionManager.java:173)
      	at org.apache.solr.common.cloud.SolrZkClient.<init>(SolrZkClient.java:127)
      	... 6 more
      
      1. SOLR-5678.patch
        2 kB
        Anshum Gupta

        Issue Links

          Activity

          Hide
          Karl Wright added a comment -

          Throwing SolrException (which is derived from RuntimeException) would be fine too.

          Show
          Karl Wright added a comment - Throwing SolrException (which is derived from RuntimeException) would be fine too.
          Hide
          Anshum Gupta added a comment -

          Changed the exception to a SolrException and added a test to confirm that the correct exception is thrown.

          Show
          Anshum Gupta added a comment - Changed the exception to a SolrException and added a test to confirm that the correct exception is thrown.
          Hide
          Mark Miller added a comment -

          Thanks Anshum and Karl - I'll commit this today.

          Show
          Mark Miller added a comment - Thanks Anshum and Karl - I'll commit this today.
          Hide
          ASF subversion and git services added a comment -

          Commit 1565056 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1565056 ]

          SOLR-5678: SolrZkClient should throw a SolrException when connect times out rather than a RuntimeException.

          Show
          ASF subversion and git services added a comment - Commit 1565056 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1565056 ] SOLR-5678 : SolrZkClient should throw a SolrException when connect times out rather than a RuntimeException.
          Hide
          ASF subversion and git services added a comment -

          Commit 1565057 from Mark Miller in branch 'dev/trunk'
          [ https://svn.apache.org/r1565057 ]

          SOLR-5678: Fix CHANGES entry

          Show
          ASF subversion and git services added a comment - Commit 1565057 from Mark Miller in branch 'dev/trunk' [ https://svn.apache.org/r1565057 ] SOLR-5678 : Fix CHANGES entry
          Hide
          ASF subversion and git services added a comment -

          Commit 1565058 from Mark Miller in branch 'dev/branches/branch_4x'
          [ https://svn.apache.org/r1565058 ]

          SOLR-5678: SolrZkClient should throw a SolrException when connect times out rather than a RuntimeException.

          Show
          ASF subversion and git services added a comment - Commit 1565058 from Mark Miller in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1565058 ] SOLR-5678 : SolrZkClient should throw a SolrException when connect times out rather than a RuntimeException.

            People

            • Assignee:
              Mark Miller
              Reporter:
              Karl Wright
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development