bluepill-rb / bluepill

simple process monitoring tool
MIT License
416 stars 52 forks source link

Sending ‘stop’ or ‘restart’ to ‘starting’ service gives SystemStackError #8

Open sentience opened 10 years ago

sentience commented 10 years ago

This issue seems to have popped up since we’ve upgraded to Ruby 2.1.1.

If we start our service:

$ sudo bluepill myapp start
Sent start to:
  :myapp_unicorn
  :myapp_sidekiq

And then, while it’s still starting:

$ sudo bluepill myapp status
myapp_unicorn(pid:): starting
myapp_sidekiq(pid:): starting

If we try to stop it or restart it:

$ sudo bluepill myapp stop
Received error from server:
#<SystemStackError: stack level too deep>
(eval):17

$ sudo bluepill myapp restart
Received error from server:
#<SystemStackError: stack level too deep>
(eval):17
cpence commented 10 years ago

I was seeing the same error when I had a misconfiguration in the services themselves, so that they never leave the starting state. When you go to bring bluepill down to refresh the configuration, you get this error, and it was confusing me -- this explanation makes perfect sense. :+1: