- Timestamp:
- May 3, 2010, 8:50:52 AM (16 years ago)
- Location:
- branches/simtest_nebulous_branches
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
pstamp/scripts/pstamp_queue_requests.pl (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/simtest_nebulous_branches
- Property svn:mergeinfo changed
-
branches/simtest_nebulous_branches/pstamp/scripts/pstamp_queue_requests.pl
r24831 r27840 19 19 my $dbserver; 20 20 my $limit; 21 my $timeout = 10; 21 22 22 23 GetOptions( 24 'timeout=i' => \$timeout, 23 25 'verbose' => \$verbose, 24 26 'dbname=s' => \$dbname, … … 69 71 70 72 my @dataStores; 71 #Look up the list of data stores t o monitor73 #Look up the list of data stores that are ready to be queried 72 74 { 73 my $command = "$pstamptool -datastore ";75 my $command = "$pstamptool -datastore -ready"; 74 76 $command .= " -dbname $dbname" if $dbname; 75 77 $command .= " -dbserver $dbserver" if $dbserver; … … 83 85 84 86 if (@$stdout_buf == 0) { 85 print STDERR "no data stores re gistered\n" if $verbose;87 print STDERR "no data stores ready\n" if $verbose; 86 88 exit 0; 87 89 } … … 111 113 my $outProduct = $ds->{outProduct}; 112 114 my $ds_id = $ds->{ds_id}; 115 my $ds_label = $ds->{label}; 116 $ds_label = undef if $ds_label eq "NULL"; 113 117 my @lines; 114 118 { 115 119 my $command = "$dsproductls --uri $ds->{uri}/index.txt"; 116 120 $command .= " --last_fileset $ds->{lastFileset}" if $ds->{lastFileset}; 121 $command .= " --timeout $timeout"; 117 122 118 123 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = … … 124 129 # don't die on "common faults" 125 130 # perhaps after some number of these we should mark the data store as disabled 126 next if ($exit_status == 200); # 500 cannot connect (data store down) 127 next if ($exit_status == 104); # 404 not found 128 # next if ($exit_status == 100); # 400 bad request 131 if (($exit_status == 200) or ($exit_status == 104)) { 132 ## now update the last_fileset column in pstampDataStore 133 update_ds_timestamp($ds_id, $dbname, $dbserver); 134 next; 135 } 136 129 137 130 138 die("Unable to perform $command: $error_code"); … … 133 141 if (@$stdout_buf == 0) { 134 142 print STDERR "no new request files in data store $ds_id\n" if $verbose; 143 update_ds_timestamp($ds_id, $dbname, $dbserver); 135 144 next; # next data store 136 145 } … … 184 193 { 185 194 my $command = "$pstamptool -addreq -uri $req_uri -ds_id $ds_id"; 195 $command .= " -label $ds_label" if $ds_label; 186 196 $command .= " -dbname $dbname" if $dbname; 187 197 $command .= " -dbserver $dbserver" if $dbserver; … … 199 209 { 200 210 ## now update the last_fileset column in pstampDataStore 201 my $command = "$pstamptool -ds_id $ds_id -moddatastore - last_fileset $lastFileset";211 my $command = "$pstamptool -ds_id $ds_id -moddatastore -set_last_fileset $lastFileset"; 202 212 $command .= " -dbname $dbname" if $dbname; 203 213 $command .= " -dbserver $dbserver" if $dbserver; … … 213 223 214 224 exit 0; 225 226 sub update_ds_timestamp { 227 my $ds_id = shift; 228 my $dbname = shift; 229 my $dbserver = shift; 230 231 my $command = "$pstamptool -ds_id $ds_id -moddatastore -update_timestamp"; 232 $command .= " -dbname $dbname" if $dbname; 233 $command .= " -dbserver $dbserver" if $dbserver; 234 my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) = 235 run(command => $command, verbose => $verbose); 236 unless ($success) { 237 die("Unable to perform pstamptool -moddatastore: $error_code"); 238 } 239 }
Note:
See TracChangeset
for help on using the changeset viewer.
