Commit 84f2b79a authored by Leigh B. Stoller's avatar Leigh B. Stoller

Must always check return value from DBQueryWarn for a null value

before using it!
parent f5b69486
...@@ -118,14 +118,22 @@ while (1) { ...@@ -118,14 +118,22 @@ while (1) {
$query_result = $query_result =
DBQueryWarn("select node_id from reserved where pid='$RELOADPID' " . DBQueryWarn("select node_id from reserved where pid='$RELOADPID' " .
"and eid='$RELOADEID' and " . "and eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL $retry_time MINUTE) > rsrv_time"); "(CURRENT_TIMESTAMP - INTERVAL $retry_time MINUTE) ".
" > rsrv_time");
if (! $query_result) {
print "DB Error. Waiting a bit.\n";
next;
}
while (($node) = $query_result->fetchrow){ while (($node) = $query_result->fetchrow){
if (!$retried{$node}) { if (!$retried{$node}) {
print "\nReload appears wedged at ".`date`.
"Power cycling and trying once more!\n";
if (system("$reboot -f $node")) { if (system("$reboot -f $node")) {
fatal("$node was wedged, but could not be power cycled.\n"); fatal("$node was wedged, but could not be power cycled.\n");
} }
print "\nReload appears wedged at ".`date`.
"Power cycling and trying once more!\n";
} }
$retried{$node} = $time; $retried{$node} = $time;
} }
...@@ -140,7 +148,6 @@ while (1) { ...@@ -140,7 +148,6 @@ while (1) {
} }
} }
# #
# Next, we do the same thing for nodes in the reloading experiment for # Next, we do the same thing for nodes in the reloading experiment for
# longer than $warn_time, and warn the admins. # longer than $warn_time, and warn the admins.
...@@ -148,7 +155,14 @@ while (1) { ...@@ -148,7 +155,14 @@ while (1) {
$query_result = $query_result =
DBQueryWarn("select node_id from reserved where pid='$RELOADPID' " . DBQueryWarn("select node_id from reserved where pid='$RELOADPID' " .
"and eid='$RELOADEID' and " . "and eid='$RELOADEID' and " .
"(CURRENT_TIMESTAMP - INTERVAL $warn_time MINUTE) > rsrv_time"); "(CURRENT_TIMESTAMP - INTERVAL $warn_time MINUTE) > ".
" rsrv_time");
if (! $query_result) {
print "DB Error. Waiting a bit.\n";
next;
}
while (($node) = $query_result->fetchrow){ while (($node) = $query_result->fetchrow){
if (!$warned{$node}) { if (!$warned{$node}) {
notify("Node $node has been in $RELOADPID/$RELOADEID for " . notify("Node $node has been in $RELOADPID/$RELOADEID for " .
...@@ -186,7 +200,7 @@ while (1) { ...@@ -186,7 +200,7 @@ while (1) {
"order by a.node_id"); "order by a.node_id");
if (! $query_result) { if (! $query_result) {
print "DB Error getting free nodes. Waiting a bit.\n"; print "DB Error. Waiting a bit.\n";
next; next;
} }
$count = $query_result->numrows; $count = $query_result->numrows;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment