Changeset 973

Show
Ignore:
Timestamp:
11/06/07 15:18:24 (1 year ago)
Author:
kindlund
Message:

Supress initial SOAP connection failures, when the VM clone first starts up.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • honeyclient/branches/exp/kindlund-dynamic_updates/lib/HoneyClient/Manager/VM/Clone.pm

    r817 r973  
    486486    if ($OBJECT_COUNT == 0) { 
    487487        HoneyClient::Manager::VM->destroy(); 
     488    } 
     489} 
     490 
     491# Handle SOAP faults. 
     492# 
     493# When initially contacting the HoneyClient::Agent daemon running 
     494# inside the cloned VM, we suppress any "Connection refused" messages 
     495# we initially receive.  If a new cloned VM is slow to respond, we 
     496# assume it's because the initial integrity check is still running 
     497# and the daemon isn't ready to accept commands from the 
     498# HoneyClient::Manager yet. 
     499sub _handleFault { 
     500 
     501    # Extract arguments. 
     502    my ($class, $res) = @_; 
     503 
     504    # Construct error message. 
     505    # Figure out if the error occurred in transport or over 
     506    # on the other side. 
     507    my $errMsg = $class->transport->status; # Assume transport error. 
     508 
     509    if (ref $res) { 
     510        $errMsg = $res->faultcode . ": ".  $res->faultstring . "\n"; 
     511    } 
     512     
     513    if (($errMsg !~ /Connection refused/) && 
     514        ($errMsg !~ /No route to host/)) { 
     515        $LOG->warn("Error occurred during processing. " . $errMsg); 
     516        Carp::carp __PACKAGE__ . "->_handleFault(): Error occurred during processing.\n" . $errMsg; 
    488517    } 
    489518} 
     
    603632        $stubAgent = getClientHandle(namespace     => "HoneyClient::Agent", 
    604633                                     address       => $self->{'ip_address'}, 
    605                                      fault_handler => undef); 
     634                                     fault_handler => \&_handleFault); 
    606635 
    607636        eval {