Solr is not killed when Spork is started by guard #3

Closed
fabn opened this Issue Mar 27, 2012 · 6 comments

Projects

None yet

3 participants

@fabn
fabn commented Mar 27, 2012

First of all, great gem with very simple instruction to setup. That said I have an issue when using your gem in conjunction with spork. First I had to insert this require before starting the solr instance

require 'sunspot/rails/tester'
Sunspot::Rails::Tester.start_original_sunspot_session

so maybe you should add this line to the spork instructions.

Now the actual issue I'm experiencing: when i quit spork instance the solr process keeps running and I have to kill it manually.

However this happens only when I'm starting spork using guard-spork gem, is there any way to fix it?

@justinko
Owner

sunspot-rails-tester calls an at_exit handler (which kills the process), so guard must be swallowing it up or something. I guess I would recommend diving into the Guard internals to see how it handles managing sub-processes.

@fabn
fabn commented Apr 23, 2012

I found the culprit of this issue here, it's related to the guard-spork gem.

@fabn fabn closed this Apr 23, 2012
@fabn fabn reopened this Apr 23, 2012
@fabn
fabn commented Apr 23, 2012

I've found that changing SIGTERM with SIGKILL doesn't solve my specific issue, since the at_exit isn't executed.

I've debugged some code and found out that at_exit callback of yout gem is not executed even using plain spork (without guard), but when I'm executing spork directly the solr process is terminated after spork termination, maybe because is a direct child of spork itself and spork do some cleanup on its child processes. I guess I should dig into spork internals to found why at_exit isn't executed at all.

Any thought on this?

@krisleech
Collaborator

@fabn Do you still need help with this? And if so, is it something you can still provide feedback on?

@fabn
fabn commented Apr 17, 2013

@krisleech unfortunately I had also other issues when working in that specific project with spork, so I decided to remove it completely from my workflow (only for that project).

@krisleech
Collaborator

No problem, thanks for getting back to me.

@krisleech krisleech closed this Apr 17, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment