Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
84f2b79a
Commit
84f2b79a
authored
Dec 18, 2002
by
Leigh B. Stoller
Browse files
Must always check return value from DBQueryWarn for a null value
before using it!
parent
f5b69486
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/reload_daemon.in
View file @
84f2b79a
...
...
@@ -118,14 +118,22 @@ while (1) {
$query_result
=
DBQueryWarn
("
select node_id from reserved where pid='
$RELOADPID
'
"
.
"
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
){
if
(
!
$retried
{
$node
})
{
print
"
\n
Reload appears wedged at
"
.
`
date
`
.
"
Power cycling and trying once more!
\n
";
if
(
system
("
$reboot
-f
$node
"))
{
fatal
("
$node
was wedged, but could not be power cycled.
\n
");
}
print
"
\n
Reload appears wedged at
"
.
`
date
`
.
"
Power cycling and trying once more!
\n
";
}
$retried
{
$node
}
=
$time
;
}
...
...
@@ -140,7 +148,6 @@ while (1) {
}
}
#
# Next, we do the same thing for nodes in the reloading experiment for
# longer than $warn_time, and warn the admins.
...
...
@@ -148,7 +155,14 @@ while (1) {
$query_result
=
DBQueryWarn
("
select node_id from reserved where pid='
$RELOADPID
'
"
.
"
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
){
if
(
!
$warned
{
$node
})
{
notify
("
Node
$node
has been in
$RELOADPID
/
$RELOADEID
for
"
.
...
...
@@ -186,7 +200,7 @@ while (1) {
"
order by a.node_id
");
if
(
!
$query_result
)
{
print
"
DB Error
getting free nodes
. Waiting a bit.
\n
";
print
"
DB Error. Waiting a bit.
\n
";
next
;
}
$count
=
$query_result
->
numrows
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment