Re: post up/down dynamic handlers not being called?

Theo Schlossnagle <[email protected]> Sun, 11 Mar 2007 11:10:59 -0400
Newsgroups gmane.comp.apache.mod-wackamole.general
Message-ID <[email protected]>
On Mar 11, 2007, at 8:46 AM, Ask Bj=F8rn Hansen wrote:

> Hi everyone,
>
> I'm running 2.1.3 on Linux (FC6).   In the past I've always managed =20=

> to just bind to *:$port so I didn't have to have wackamole manage =20
> another service.    Today I wanted to setup something to bind on a =20
> handful of specific IPs and then stop and start a service as =20
> appropriate.
>
> In my wackamole.conf I have the following:
>
> PerlUseLib /var/services/wackamole-foo-ext/lib
> PerlUse SolWack
>
> RunDynamic SolWack::post_up post up
> RunDynamic SolWack::post_down post down
> RunDynamic SolWack::on_up on up
> RunDynamic SolWack::on_down on down
>
> As far as I can tell only the "on up/down" handlers are being =20
> called.   The "post up/down" aren't.
>
> I wanted to use the post up/down ones so I could just do my service =20=

> stop/start stuff after all the IPs had been moved.
> Any hints?

It's "supposed" to work the way you had expected it.

The code for all that stuff is ugly but pretty simple:

wackamole.c:

Handle_Balance
__foreach change
____if now my responsibility
______num_acquired++
______Acquire() [which calls user loaded on_up]
____if no longer my responsibility
______num_released++
______Release() [which calls user loaded on_down]
__if num_acquired
____call user loaded post_up
__if num_released
____call user loaded post_down


Could you gdb attach to that and breakpoint at: =20
execute_all_user_simple, trigger a IP shift and then step through =20
that for anything obvious.
That function is called on the post_up and post_down to dispatch to =20
perl and other user-space stuff.

// Theo Schlossnagle
// Principal@OmniTI: http://omniti.com
// Esoteric Curio: http://www.lethargy.org/~jesus/