[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ha-dev
Subject:    [Linux-ha-dev] Debugging hard loops in heartbeat
From:       Alan Robertson <alanr () unix ! sh>
Date:       2004-01-19 7:50:07
Message-ID: 400B8C2F.4030804 () unix ! sh
[Download RAW message or body]

Hi,

When debugging the recent infinite loop problems, I forgot the best way to 
debug them.  Because I forgot (and I wrote the code to do it), it seems 
reasonable to assume others might not know about the built-in mechanisms for 
dealing with them.

There is code in heartbeat which (when enabled) will terminate most infinite 
loops within a few seconds.  This is quite important, since when heartbeat 
goes into an infinite loop, nothing else runs on the system - which is a 
very annoying behavior.

This mechanism will cause the offending process to (try and) make a core dump.

Enabling it is simple:

	issue a ulimit -c unlimited command

	Start heartbeat with at least one -d option (or add the debug
		parameter to the ha.cf file) from the above shell

Now, you're set.  Heartbeat will hard loop no more than about six seconds, 
then it will take a core dump.

However, it can consume as much CPU time as it wants, as long as each 
process doesn't consume more than about 6 seconds every minute (I've 
forgotten the exact ratio).

-- 
     Alan Robertson <alanr@unix.sh>

"Openness is the foundation and preservative of friendship...  Let me claim 
from you at all times your undisguised opinions." - William Wilberforce

_______________________________________________________
Linux-HA-Dev: Linux-HA-Dev@lists.linux-ha.org
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic