Modified ldirectord memory leak
| Newsgroups | gmane.linux.highavailability.ultramonkey |
|---|---|
| Message-ID | <[email protected]> |
We modified our ldirectord to check for SOAP service
availability. It appears, however, there is something
wrong with it, even though it does work.
The symptoms are:
* Swap usage is always at max
* Cannot take out servers from grid by commenting them
out in the config file - have to restart ldirectord
for that to work again.
The source of the problem may be this line:
local $SIG{'__DIE__'} = "DEFAULT";
It was added in the eval{} statement because the $@
error handling block was bombing without it.
I am attaching a stripped version of the function to
give you more context. Perhaps someone with experience
in building custom checks can help.
Thank you,
-Andrei
[email protected]
soap_check.txt
(text/plain, 1016 B)
sub check_soap
{
require SOAP::Lite;
my ($v, $r) = @_;
my $port=(defined $$v{checkport}?$$v{checkport}:$$r{port});
unless ($$v{login} && $$v{passwd}) {
service_set($v, $r, "down");
&ld_log("Error: Must specify a login and passwd for soap. Not adding $$r{server}.\n");
return 1;
}
$service = SOAP::Lite ...;
if (!$service) {
service_set($v, $r, "down");
&ld_debug(4, "Failed to create SOAP object");
return 1;
}
$method = SOAP::Data ...;
&ld_debug(2, "Checking soap server=$$r{server}\n");
eval {
local $SIG{'__DIE__'} = "DEFAULT";
$result = $service->call()
DoIt();
};
if ($@) {
&ld_debug(4, "Failed to call $$r{server}: $@");
service_set($v, $r, "down");
return 1;
}
if ($result->fault) {
&ld_debug(4, "Fault from $$r{server}: " . $result->faultcode . ' - ' . $result->faultstring);
service_set($v, $r, "down");
return 1;
}
service_set($v, $r, "up");
return 0;
}