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 Vishnu Mishra <vd...@gmail.com> on 2014/12/19 10:05:20 UTC

How To Interrupt Solr Query Execution

Hi, I am using solr 4.9 for searching  over 90 million+ documents. My Solr is
running on tomcat server and  I am  querying Solr from an application. I
have a problem with long-running queries against Solr. Although I have set
timeAllowed to 40000ms, but it seems that solr still running this query
until it processed fully. I read some articles where it is written that 

"*Internally, Solr does nothing to time out any requests -- it lets both
updates and queries take however long they need to take to be processed
fully.*"

Is this what Solr does? If so, is there a configuration option to change
this behavior? or can I interrupt solr query execution.



--
View this message in context: http://lucene.472066.n3.nabble.com/How-To-Interrupt-Solr-Query-Execution-tp4175190.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: How To Interrupt Solr Query Execution

Posted by Gregg Donovan <gr...@gmail.com>.
SOLR-5986 looks like a great enhancement for enforcing timeouts. I'm
curious about how to handle *manual* cancellation.

We're working on backup requests -- e.g. wait till 90% of shards have
responded then send out a backup request for the lagging (e.g. GC, cache
miss, overloaded, etc.) shards after a configurable delay -- and would like
to be able to cancel the slower to respond shard. From what I can see in
SOLR-5986, I'm not sure that Solr will check the interrupt status of a
thread if it is manually interrupted. Am I reading that right? If so, would
it make sense to add a check for the interrupt status in
SolrQueryTimeoutImpl#shouldExit()[1]?


[1]
https://github.com/apache/lucene-solr/blob/trunk/solr/core/src/java/org/apache/solr/search/SolrQueryTimeoutImpl.java#L57:L63

On Fri, Dec 19, 2014 at 10:15 AM, Shalin Shekhar Mangar <
shalinmangar@gmail.com> wrote:

> Also note SOLR-5986 which will help in such cases when queries are stuck
> iterating through terms. This will be released with Solr 5.0
>
> On Fri, Dec 19, 2014 at 9:14 AM, Mikhail Khludnev <
> mkhludnev@griddynamics.com> wrote:
> >
> > Hello,
> > Note, that timeout is checked only during the search. But for example, it
> > isn't checked during facet counting. Check debugQuery=true output, to
> > understand how the processing time is distributed across components.
> >
> > On Fri, Dec 19, 2014 at 12:05 PM, Vishnu Mishra <vd...@gmail.com>
> wrote:
> > >
> > > Hi, I am using solr 4.9 for searching  over 90 million+ documents. My
> > Solr
> > > is
> > > running on tomcat server and  I am  querying Solr from an application.
> I
> > > have a problem with long-running queries against Solr. Although I have
> > set
> > > timeAllowed to 40000ms, but it seems that solr still running this query
> > > until it processed fully. I read some articles where it is written that
> > >
> > > "*Internally, Solr does nothing to time out any requests -- it lets
> both
> > > updates and queries take however long they need to take to be processed
> > > fully.*"
> > >
> > > Is this what Solr does? If so, is there a configuration option to
> change
> > > this behavior? or can I interrupt solr query execution.
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > >
> >
> http://lucene.472066.n3.nabble.com/How-To-Interrupt-Solr-Query-Execution-tp4175190.html
> > > Sent from the Solr - User mailing list archive at Nabble.com.
> > >
> >
> >
> > --
> > Sincerely yours
> > Mikhail Khludnev
> > Principal Engineer,
> > Grid Dynamics
> >
> > <http://www.griddynamics.com>
> > <mk...@griddynamics.com>
> >
>
>
> --
> Regards,
> Shalin Shekhar Mangar.
>

Re: How To Interrupt Solr Query Execution

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
Also note SOLR-5986 which will help in such cases when queries are stuck
iterating through terms. This will be released with Solr 5.0

On Fri, Dec 19, 2014 at 9:14 AM, Mikhail Khludnev <
mkhludnev@griddynamics.com> wrote:
>
> Hello,
> Note, that timeout is checked only during the search. But for example, it
> isn't checked during facet counting. Check debugQuery=true output, to
> understand how the processing time is distributed across components.
>
> On Fri, Dec 19, 2014 at 12:05 PM, Vishnu Mishra <vd...@gmail.com> wrote:
> >
> > Hi, I am using solr 4.9 for searching  over 90 million+ documents. My
> Solr
> > is
> > running on tomcat server and  I am  querying Solr from an application. I
> > have a problem with long-running queries against Solr. Although I have
> set
> > timeAllowed to 40000ms, but it seems that solr still running this query
> > until it processed fully. I read some articles where it is written that
> >
> > "*Internally, Solr does nothing to time out any requests -- it lets both
> > updates and queries take however long they need to take to be processed
> > fully.*"
> >
> > Is this what Solr does? If so, is there a configuration option to change
> > this behavior? or can I interrupt solr query execution.
> >
> >
> >
> > --
> > View this message in context:
> >
> http://lucene.472066.n3.nabble.com/How-To-Interrupt-Solr-Query-Execution-tp4175190.html
> > Sent from the Solr - User mailing list archive at Nabble.com.
> >
>
>
> --
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
>
> <http://www.griddynamics.com>
> <mk...@griddynamics.com>
>


-- 
Regards,
Shalin Shekhar Mangar.

Re: How To Interrupt Solr Query Execution

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Hello,
Note, that timeout is checked only during the search. But for example, it
isn't checked during facet counting. Check debugQuery=true output, to
understand how the processing time is distributed across components.

On Fri, Dec 19, 2014 at 12:05 PM, Vishnu Mishra <vd...@gmail.com> wrote:
>
> Hi, I am using solr 4.9 for searching  over 90 million+ documents. My Solr
> is
> running on tomcat server and  I am  querying Solr from an application. I
> have a problem with long-running queries against Solr. Although I have set
> timeAllowed to 40000ms, but it seems that solr still running this query
> until it processed fully. I read some articles where it is written that
>
> "*Internally, Solr does nothing to time out any requests -- it lets both
> updates and queries take however long they need to take to be processed
> fully.*"
>
> Is this what Solr does? If so, is there a configuration option to change
> this behavior? or can I interrupt solr query execution.
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/How-To-Interrupt-Solr-Query-Execution-tp4175190.html
> Sent from the Solr - User mailing list archive at Nabble.com.
>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>