guard / guard-spork

Guard::Spork automatically manage Spork DRb servers
https://rubygems.org/gems/guard-spork
MIT License
296 stars 58 forks source link

guard hangs when I type exit at the guard prompt #108

Closed agibralter closed 11 years ago

agibralter commented 11 years ago

It seems like Spork catches the signal and does not let it pass through to stop Guard:

class Spork::Server
  def listen
    @run_strategy.assert_ready!
    trap("SIGINT") { sig_int_received }
    trap("SIGTERM") { abort; exit!(0) }
    trap("USR2") { abort; restart } if Signal.list.has_key?("USR2")
    @drb_service = DRb.start_service("druby://127.0.0.1:#{port}", self)
    if @run_strategy.class == Spork::RunStrategy::Forking
      Spork.each_run { @drb_service.stop_service }
    end
    stderr.puts "Spork is ready and listening on #{port}!"
    stderr.flush
    DRb.thread.join
  end
end

Has anyone else encountered this issue with Guard + Spork?

thibaudgg commented 11 years ago

I don't use guard-spork anymore so I couldn't help you. Sorry!

agibralter commented 11 years ago

@thibaudgg do you use something else instead now?

thibaudgg commented 11 years ago

@agibralter not really, I mostly test all my app logic in isolation now. There is a good article about that: http://silkandspinach.net/2011/08/08/why-i-dont-use-spork/

agibralter commented 11 years ago

Interesting -- thank you for passing that along.

thibaudgg commented 11 years ago

You're welcome!

tobinharris commented 10 years ago

We're seeing this. I'm not sure it's really solved the issue ;) Anyone actually found a solution?