Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed sunspot-solr stop - kill child processes #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkrol89
Copy link

@kkrol89 kkrol89 commented Jul 14, 2012

If you run globally (without bundle)

sunspot-solr start
sunspot-solr stop

then java process with solr program is not killed properly and it still exists in processes list.

By running:

ps auxf

you can see that there are two processes created:

konrad    3301  0.0  0.0   4224   584 ?        Ss   11:32   0:00 sh -c java -Dsolr.data.dir\=/tmp -Dsolr.solr.home\=/home/konrad/.rvm/gems/ruby-1.9.3-p194/gems/sunspot_solr-1.3.3/solr/solr -jar start.jar
konrad    3304 17.0  2.3 1148712 69708 ?       Sl   11:32   0:03  \_ java -Dsolr.data.dir=/tmp -Dsolr.solr.home=/home/konrad/.rvm/gems/ruby-1.9.3-p194/gems/sunspot_solr-1.3.3/solr/solr -jar start.jar

Following command:

sunspot-solr stop

kills only the parent process (sh) and java process is still runing:

konrad    3304  2.4  2.3 1148712 69708 ?       Sl   11:32   0:03 java -Dsolr.data.dir=/tmp -Dsolr.solr.home=/home/konrad/.rvm/gems/ruby-1.9.3-p194/gems/sunspot_solr-1.3.3/solr/solr -jar start.jar

This commit fixes this problem. Now sunspot-solr stop command kills also all child processes of process which pid was saved.

@kpolitowicz
Copy link

Thanks for the pull request. I'm experiencing this problem running stop through bundle as well:

RAILS_ENV=staging bundle exec rake sunspot:solr:start
RAILS_ENV=staging bundle exec rake sunspot:solr:stop

leaves the java process alive.

@antonpaisov
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants