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 Ere Maijala <er...@helsinki.fi> on 2015/09/16 08:52:57 UTC

5 second timeout in bin/solr stop command

Hi All,

There's currently a five second delay in the bin/solr script when 
stopping a Solr instance before it's forcefully killed. In our 
experience this is not enough to allow a graceful shutdown of an active 
SolrCloud node and it seems a bit brutal to kill the process in the 
middle of shutdown. Since the script already has the bits for checking 
process status, how about checking it once a second for 30 seconds or 
until the process has stopped and only kill it if it doesn't shut down 
in that time?

Thanks,
Ere

-- 
Ere Maijala
Kansalliskirjasto / The National Library of Finland

Re: 5 second timeout in bin/solr stop command

Posted by Ere Maijala <er...@helsinki.fi>.
16.9.2015, 16.16, Shawn Heisey kirjoitti:
> I agree here.  I don't like the forceful termination unless it becomes
> truly necessary.
>
> I changed the timeout to 20 seconds in the script installed in
> /etc/init.d ... a bit of a brute force approach.  When I find some time,
> I will think about how to make this better, and choose a better default
> value.  30 seconds is probably good.  It should also be configurable,
> probably in the /var/solr/solr.in.sh config fragment.

Thanks, Shawn. Insprired by this I filed an issue and attached a patch 
in Jira, see https://issues.apache.org/jira/browse/SOLR-8065. The patch 
makes the stop function behave like start so that it waits up to 30 
seconds for the process to shut down and checks the status once a 
second. I didn't make the timeout configurable since I think 30 seconds 
should be enough in any situation (this may be a statement I'll regret 
later..) and the script doesn't wait any longer than necessary. But if 
you find that a necessity, it shouldn't be too difficult to add.

--Ere

-- 
Ere Maijala
Kansalliskirjasto / The National Library of Finland

Re: 5 second timeout in bin/solr stop command

Posted by Shawn Heisey <ap...@elyograg.org>.
On 9/16/2015 12:52 AM, Ere Maijala wrote:
> There's currently a five second delay in the bin/solr script when
> stopping a Solr instance before it's forcefully killed. In our
> experience this is not enough to allow a graceful shutdown of an active
> SolrCloud node and it seems a bit brutal to kill the process in the
> middle of shutdown. Since the script already has the bits for checking
> process status, how about checking it once a second for 30 seconds or
> until the process has stopped and only kill it if it doesn't shut down
> in that time?

I agree here.  I don't like the forceful termination unless it becomes
truly necessary.

I changed the timeout to 20 seconds in the script installed in
/etc/init.d ... a bit of a brute force approach.  When I find some time,
I will think about how to make this better, and choose a better default
value.  30 seconds is probably good.  It should also be configurable,
probably in the /var/solr/solr.in.sh config fragment.

Thanks,
Shawn