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
a44cc094
Commit
a44cc094
authored
Jun 21, 2017
by
Leigh B Stoller
Browse files
Throw some debugging in to try and catch idlestats stderr output
when null data is returned.
parent
bdab2946
Changes
1
Hide whitespace changes
Inline
Side-by-side
protogeni/lib/GeniCluster.pm.in
View file @
a44cc094
#
!/usr/bin/perl -w
T
#
!/usr/bin/perl -w
#
#
Copyright
(
c
)
2008
-
2017
University
of
Utah
and
the
Flux
Group
.
#
...
...
@@ -59,7 +59,7 @@ use Data::Dumper;
use
Date
::
Parse
;
use
POSIX
qw
(
strftime
);
use
Time
::
Local
;
use
File
::
Temp
qw
(
tempfile
);
use
File
::
Temp
qw
(
tempfile
tmpnam
);
use
Project
;
use
NodeType
;
use
Node
;
...
...
@@ -488,8 +488,15 @@ sub SliceIdleData($)
}
$
limit
=
emutil
::
TBDateStringLocal
($
limit
);
#
For
debugging
my
$
debugfile
=
tmpnam
();
my
$
command
=
"$WAP $IDLESTATS -s -R -B -S '$limit' "
.
"-e $pid,$eid 2>$debugfile"
;
GeniUtil
::
FlipToElabMan
();
if
(
! open(IDLE, "$WAP $IDLESTATS -s -R -B -S '$limit' -e $pid,$eid |")) {
if
(
! open(IDLE, "$command |")) {
print
STDERR
"$command
\n
"
;
unlink
($
debugfile
);
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
"Could not start idlestats"
)
}
...
...
@@ -498,11 +505,23 @@ sub SliceIdleData($)
$
output
.=
$
_
;
}
if
(
! close(IDLE)) {
if
(-
s
$
debugfile
)
{
print
STDERR
"$command
\n
"
;
my
$
stuff
=
`/
bin
/
cat
$
debugfile
`;
print
STDERR
$
stuff
;
}
unlink
($
debugfile
);
return
GeniResponse
->
Create
(
GENIRESPONSE_ERROR
,
undef
,
($
! ? "Pipe error running idlestats: $!" :
"idlestats exited with $?"
)
.
"
\n
"
.
$
output
);
}
if
(-
s
$
debugfile
)
{
print
STDERR
"$command
\n
"
;
my
$
stuff
=
`/
bin
/
cat
$
debugfile
`;
print
STDERR
$
stuff
;
}
unlink
($
debugfile
);
#
#
We
get
a
giant
json
encoded
string
back
.
#
...
...
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