flapping does not work with 0.11.0 on Linux for non daemon process

46 views
Skip to first unread message

Tilo Prütz

unread,
Jan 15, 2011, 3:11:57 AM1/15/11
to god...@googlegroups.com
Hi,

I am using god 0.11.0 on a Gentoo Linux for monitoring a non daemon
process and have the same symptoms as in
http://groups.google.com/group/god-rb/browse_thread/thread/41c7bc1329f57bb2#
(which I can't continue).

The :flapping condition does some logging but the process is flapping
forever.

I tracked it down a little bit and found out, that the :flapping
condition enqueues a driver operation due to the trigger call in
Flapping#process (line 74 of god/conditions/flapping.rb). This driver
operation is always in a queue with two driver events (for
:process_running and :tries) which will be handled first.
The handling of the :process_running event then leads to a clean up of
the events list and the driver operation of the :flapping condition is
never been processed.

I am not deep enough into the code to understand how it is intended to work.
Could anyone help or give a clue where to dig further?


Thanks

>tilo

god.conf
god.log

captainf

unread,
Jan 17, 2011, 3:14:07 AM1/17/11
to god.rb
Hi,

> The handling of the :process_running event then leads to a clean up of
> the events list and the driver operation of the :flapping condition is
> never been processed.

I patched it like this
#
# this patch is a solution against the over active Driver.clear_events
# PollConditions associated with the lifecycle part of the
configuration
# should not be removed from the event queue.
# Instead of tracing which events need to be kept, it reschedules the
associated
# conditions (lifecycle metrics <= Task.metrics[state] where state =
nil)
#

module God
class Driver
def lifecycle_conditions
metrics = @task.metrics[nil] unless @task.nil? ||
@task.metrics[nil].nil?
metrics ||= []
return metrics.map{|m| m.conditions}.flatten.uniq
end
def clear_events

@events.clear
lifecycle_conditions.each {|lc| schedule(lc) if
lc.respond_to? :interval}
end
end
end
Reply all
Reply to author
Forward
0 new messages