Author: fapeeler
Date: Thu Nov  7 17:52:34 2013
New Revision: 1539735

URL: http://svn.apache.org/r1539735
Log:
VCL-734

vcld: Added update_request_state before make_new_child for non-cluster requests
State.pm: moved close bracket to isolate state change to cluster reservations

Modified:
    vcl/trunk/managementnode/bin/vcld
    vcl/trunk/managementnode/lib/VCL/Module/State.pm

Modified: vcl/trunk/managementnode/bin/vcld
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/bin/vcld?rev=1539735&r1=1539734&r2=1539735&view=diff
==============================================================================
--- vcl/trunk/managementnode/bin/vcld (original)
+++ vcl/trunk/managementnode/bin/vcld Thu Nov  7 17:52:34 2013
@@ -359,6 +359,13 @@ sub main () {
                                my $computer_id = 
$data_structure->get_computer_id();
                                insertloadlog($reservation_id, $computer_id, 
"begin", "beginning to process, state is $request_state_name");
                                
+                               # Update state to pending for non-cluster 
reservations to limit another attempt at processing 
+                               if($reservation_count == 1) {
+                                       # Update the request state to pending
+                                       if (!update_request_state($request_id, 
"pending", $request_state_name)) {
+                                          notify($ERRORS{'WARNING'}, 0, 
"failed to update request state to pending");
+                                       }
+                               }
                                # Make a new child process, passing it the 
request/reservation info
                                make_new_child({request_info => \%request_info, 
data_structure => $data_structure});
                        } ## end foreach my $reservation_id (keys 
%{$info{request...

Modified: vcl/trunk/managementnode/lib/VCL/Module/State.pm
URL: 
http://svn.apache.org/viewvc/vcl/trunk/managementnode/lib/VCL/Module/State.pm?rev=1539735&r1=1539734&r2=1539735&view=diff
==============================================================================
--- vcl/trunk/managementnode/lib/VCL/Module/State.pm (original)
+++ vcl/trunk/managementnode/lib/VCL/Module/State.pm Thu Nov  7 17:52:34 2013
@@ -178,11 +178,13 @@ sub initialize {
                        if 
(!$self->wait_for_child_reservations_to_begin('begin', 60, 3)) {
                                $self->reservation_failed("child reservation 
processes failed to begin");
                        }
-               }
                
-               # Update the request state to pending
-               if (!update_request_state($request_id, "pending", 
$request_state_name)) {
-                       notify($ERRORS{'WARNING'}, 0, "failed to update request 
state to pending");
+                               
+                       # Update the request state to pending for this cluster 
reservation.
+                       # Single reservations are set to pending in vcld
+                       if (!update_request_state($request_id, "pending", 
$request_state_name)) {
+                               notify($ERRORS{'WARNING'}, 0, "failed to update 
request state to pending");
+                       }
                }
        }
        
@@ -549,7 +551,7 @@ sub state_exit {
                
                # Update the request state
                if (!is_request_deleted($request_id)) {
-                       notify($ERRORS{'OK'}, 0, "request has been deleted, NOT 
updating new state: $request_state_name_new old state: 
$request_state_name_old");
+                       notify($ERRORS{'OK'}, 0, "request has NOT been deleted, 
updating new state: $request_state_name_new old state: 
$request_state_name_old");
                        if (!update_request_state($request_id, 
$request_state_name_new, $request_state_name_old)) {
                                notify($ERRORS{'WARNING'}, 0, "failed to change 
request state: $request_state_name_old/$request_laststate_name_old --> 
$request_state_name_new/$request_state_name_old");
                        }


Reply via email to