You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Chetas Joshi <ch...@gmail.com> on 2017/02/22 23:59:35 UTC

CloudSolrClient stuck in a loop with a recurring exception

Hello,

I am using Solr 5.5.1. Solr Cloud of 80 nodes deployed on HDFS.

To get back results from Solr, I use the cursor approach and the
cloudSolrClient object. While a query was running, I took the solr Cloud
down. The client got stuck in a loop with the following exception:

2017-02-22 15:27:06,985 ERROR o.a.s.c.solrj.impl.CloudSolrClient ~ Request
to collection xxxxx failed due to (510) org.apache.solr.common.SolrException
: Could not find a healthy node to handle the request., retry? 0
.
.
.
.
.
2017-02-22 15:27:06,994 ERROR o.a.s.c.solrj.impl.CloudSolrClient ~ Request
to collection xxxxxx failed due to (510) org.apache.solr.common.
SolrException: Could not find a healthy node to handle the request., retry?
5

Here is my code snippet. I go through a loop until I get the last page to
get back all the results from Solr using the cursor approach. Do I need to
take care of the above situation/exceptions in my code?

while(true){

val rsp: QueryResponse = *cloudSolrclient*.query(cursorQ)
val nextCursorMark: String = rsp.getNextCursorMark

val nextCursorMark: String = rsp.getNextCursorMark

if (cursorMark.equals(nextCursorMark)) break; cloudSolrClient.close()

}

These exceptions are getting generated from *cloudSolrclient*.query(cursorQ)
while getting back the response. Should I catch those exceptions and close
the client if they cross a particular threshold?

Chetas.

Re: CloudSolrClient stuck in a loop with a recurring exception

Posted by Chetas Joshi <ch...@gmail.com>.
Yes, it is scala.
And yes, I just wanted to confirm that I had to add exception handling and
break out of the loop.

Chetas.

On Wed, Feb 22, 2017 at 4:25 PM, Shawn Heisey <ap...@elyograg.org> wrote:

> On 2/22/2017 4:59 PM, Chetas Joshi wrote:
> > 2017-02-22 15:27:06,994 ERROR o.a.s.c.solrj.impl.CloudSolrClient ~
> Request
> > to collection xxxxxx failed due to (510) org.apache.solr.common.
> > SolrException: Could not find a healthy node to handle the request.,
> retry?
> >
> > Here is my code snippet. I go through a loop until I get the last page to
> > get back all the results from Solr using the cursor approach. Do I need
> to
> > take care of the above situation/exceptions in my code?
> >
> > while(true){
> >
> > val rsp: QueryResponse = *cloudSolrclient*.query(cursorQ)
> > val nextCursorMark: String = rsp.getNextCursorMark
> >
> > val nextCursorMark: String = rsp.getNextCursorMark
> >
> > if (cursorMark.equals(nextCursorMark)) break; cloudSolrClient.close()
> >
> > }
>
> This doesn't look like Java code, so I'm assuming it's Scala, and I do
> not have any experience with that language.  There doesn't seem to be
> any exception handling.  The query method will throw an exception if the
> server's not available.  You must handle that in your code and take
> appropriate action, such as breaking out of the loop.
>
> Thanks,
> Shawn
>
>

Re: CloudSolrClient stuck in a loop with a recurring exception

Posted by Shawn Heisey <ap...@elyograg.org>.
On 2/22/2017 4:59 PM, Chetas Joshi wrote:
> 2017-02-22 15:27:06,994 ERROR o.a.s.c.solrj.impl.CloudSolrClient ~ Request
> to collection xxxxxx failed due to (510) org.apache.solr.common.
> SolrException: Could not find a healthy node to handle the request., retry?
>
> Here is my code snippet. I go through a loop until I get the last page to
> get back all the results from Solr using the cursor approach. Do I need to
> take care of the above situation/exceptions in my code?
>
> while(true){
>
> val rsp: QueryResponse = *cloudSolrclient*.query(cursorQ)
> val nextCursorMark: String = rsp.getNextCursorMark
>
> val nextCursorMark: String = rsp.getNextCursorMark
>
> if (cursorMark.equals(nextCursorMark)) break; cloudSolrClient.close()
>
> }

This doesn't look like Java code, so I'm assuming it's Scala, and I do
not have any experience with that language.  There doesn't seem to be
any exception handling.  The query method will throw an exception if the
server's not available.  You must handle that in your code and take
appropriate action, such as breaking out of the loop.

Thanks,
Shawn