LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Crashing ldirectord

To: Rob de Wit <rdewit@xxxxxxxxxxxx>
Subject: Re: [lvs-users] Crashing ldirectord
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Mon, 7 Jun 2010 15:41:26 +0900
On Tue, Jun 01, 2010 at 11:24:20AM +0200, Rob de Wit wrote:
> 
> Hi all,
> 
> We've been using ldirectord for years now and because I wanted to
> use the 'checktype=external' option, we've upgraded heartbeat and
> it's accompanying software.
> 
> We've never had problems untill the upgrade: every now and then
> ldirectord just quits. I've run it in debug mode and this is what
> I get:
> 
> DEBUG2: check_http: http://10.0.10.1:80/nagios.php is up
> DEBUG2: Checking negotiate: real
> server=negotiate:http:tcp:10.0.10.2:80:XXXX.XX::75:gate:\/nagios\.php:OK
> (virtual=tcp:XX.XX.XX.XX:80)
> DEBUG2: check_http: url="http://10.0.10.2:80/nagios.php";
> virtualhost="XXXX.XX"
> LWP::UserAgent::new: ()
> DEBUG2: Starting Check
> DEBUG2: Starting HTTP/HTTPS
> LWP::UserAgent::request: ()
> LWP::UserAgent::send_request: GET http://10.0.10.2:80/nagios.php
> LWP::UserAgent::_need_proxy: Not proxied
> LWP::Protocol::http::request: ()
> LWP::Protocol::collect: read 16 bytes
> Can't call method "is_success" on an undefined value at
> /usr/sbin/ldirectord line 2759.
> failure
> 
> I'm no perl expert, but looking at the code, it seems to be
> unhappily surprised by an undefined response from $ua->request.
> 
> Why would that happen?
> How can I stop ldirectord from crashing on it?
> 
> ldirectord --version => Linux Director v1.186-ha

Hi Rob,

What I suspect is happening is that $res is not being set sometimes,
most likely because of a timeout. Could you try the following patch
to see if it helps? You should be able to apply it to your
ldirectord script.

diff -r 7d0189d5dae8 ldirectord/ldirectord.in
--- a/ldirectord/ldirectord.in  Mon Jun 07 15:13:25 2010 +0900
+++ b/ldirectord/ldirectord.in  Mon Jun 07 15:39:05 2010 +0900
@@ -2746,6 +2746,11 @@
                alarm 0; # Cancel the alarm
        };
 
+       if (not defined $res) {
+               &ld_debug(2, "check_http: Timeout?");
+               goto down;
+       }
+
        if ($$v{service} eq "https") {
                &ld_debug(2, "SSL-Cipher: " .
                        $res->header('Client-SSL-Cipher'));
@@ -2767,6 +2772,7 @@
        service_set($v, $r, "down", {do_log => 1}, $log_message);
 
        &ld_debug(3, "Headers " .  $res->headers->as_string);
+down:
        &ld_debug(2, "check_http: $$r{url} is down\n");
        return $SERVICE_DOWN;
 }

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

<Prev in Thread] Current Thread [Next in Thread>