I have god watching delayed job and it generally works.  However, when
a worker dies, it sometimes gets caught in "init" rather than
transitioning back to start.  If I kill all works, stop god then
restart it, they all come back up.  Any ideas?

One thing to note is that my app has a long ~15-20 sec startup.

Here's my config transitions:

    w.interval      = 30.seconds
    w.start_grace   = 20.seconds
    w.restart_grace = 20.seconds

    # retart if memory gets too high
    w.transition(:up, :restart) do |on|
      on.condition(:memory_usage) do |c|
        c.above = 200.megabytes
        c.times = 2
      end
    end

    # determine the state on startup
    w.transition(:init, { true => :up, false => :start }) do |on|
      on.condition(:process_running) do |c|
        c.running = true
      end
    end

    # determine when process has finished starting
    w.transition([:start, :restart], :up) do |on|
      on.condition(:process_running) do |c|
        c.running = true
        c.interval = 5.seconds
      end

      # failsafe
      on.condition(:tries) do |c|
        c.times = 5
        c.transition = :start
        c.interval = 5.seconds
        #c.notify = 'monitor'
      end
    end

    # start if process is not running
    w.transition(:up, :start) do |on|
      on.condition(:process_running) do |c|
        c.running = false
      end
      #on.condition(:process_exits) do |c|
      #  c.notify = 'monitor'
      #end
    end

    w.lifecycle do |on|
      on.condition(:flapping) do |c|
        c.to_state = [:start, :restart]
        c.times = 3
        c.within = 10.minute
        c.notify = 'monitor'
      end
    end

-- 
You received this message because you are subscribed to the Google Groups 
"god.rb" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/god-rb?hl=en.

Reply via email to