You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@vcl.apache.org by ar...@apache.org on 2010/10/08 17:01:19 UTC
svn commit: r1005854 [2/2] - in /incubator/vcl/trunk/managementnode/lib/VCL:
./ Module/ Module/Provisioning/VMware/
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm?rev=1005854&r1=1005853&r2=1005854&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/Semaphore.pm Fri Oct 8 15:01:19 2010
@@ -100,7 +100,7 @@ sub get_lockfile {
}
# Set the wait defaults if not supplied as arguments
- $total_wait_seconds = 30 if !$total_wait_seconds;
+ $total_wait_seconds = 30 if !defined($total_wait_seconds);
$attempt_delay_seconds = 5 if !$attempt_delay_seconds;
# Attempt to lock the file
@@ -182,7 +182,14 @@ sub open_lockfile {
return;
}
elsif (@locking_pids) {
- notify($ERRORS{'DEBUG'}, 0, "file is locked by another process: @locking_pids");
+ # Attempt to retrieve the names of the locking process(es)
+ my ($ps_exit_status, $ps_output) = run_command("ps -o pid=,cmd= @locking_pids", 1);
+ if (defined($ps_output) && !grep(/(ps:)/, @$ps_output)) {
+ notify($ERRORS{'DEBUG'}, 0, "file is locked by another process: @locking_pids\n" . join("\n", @$ps_output));
+ }
+ else {
+ notify($ERRORS{'DEBUG'}, 0, "file is locked by another process: @locking_pids");
+ }
return;
}
else {
@@ -259,7 +266,7 @@ sub release_lockfile {
sub DESTROY {
my $self = shift;
- notify($ERRORS{'DEBUG'}, 0, "destructor called: $self");
+ my $address = sprintf('%x', $self);
for my $file_path (keys %{$self->{file_handles}}) {
$self->release_lockfile($file_path);
@@ -267,6 +274,8 @@ sub DESTROY {
# Check for an overridden destructor
$self->SUPER::DESTROY if $self->can("SUPER::DESTROY");
+
+ notify($ERRORS{'DEBUG'}, 0, "destroyed Semaphore object, memory address: $address");
} ## end sub DESTROY
#/////////////////////////////////////////////////////////////////////////////
Modified: incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm?rev=1005854&r1=1005853&r2=1005854&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/Module/State.pm Fri Oct 8 15:01:19 2010
@@ -899,7 +899,7 @@ sub check_image_os {
sub DESTROY {
my $self = shift;
- notify($ERRORS{'DEBUG'}, 0, "destructor called, ref(\$self)=" . ref($self));
+ notify($ERRORS{'DEBUG'}, 0, "ref($self) destructor called");
# If not a blockrequest, delete computerloadlog entry
if ($self && $self->data && !$self->data->is_blockrequest()) {
Modified: incubator/vcl/trunk/managementnode/lib/VCL/utils.pm
URL: http://svn.apache.org/viewvc/incubator/vcl/trunk/managementnode/lib/VCL/utils.pm?rev=1005854&r1=1005853&r2=1005854&view=diff
==============================================================================
--- incubator/vcl/trunk/managementnode/lib/VCL/utils.pm (original)
+++ incubator/vcl/trunk/managementnode/lib/VCL/utils.pm Fri Oct 8 15:01:19 2010
@@ -2696,7 +2696,7 @@ sub nmap_port {
}
if (grep(/open/i, @$output)) {
- notify($ERRORS{'DEBUG'}, 0, "port $port is open on $hostname");
+ #notify($ERRORS{'DEBUG'}, 0, "port $port is open on $hostname");
return 1;
}
elsif (grep(/(nmap:|warning)/i, @$output)) {
@@ -2704,7 +2704,7 @@ sub nmap_port {
return;
}
else {
- notify($ERRORS{'DEBUG'}, 0, "port $port is closed on $hostname");
+ #notify($ERRORS{'DEBUG'}, 0, "port $port is closed on $hostname");
return 0;
}
} ## end sub nmap_port