Skip to content
GitLab
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
f11d59ba
Commit
f11d59ba
authored
Oct 15, 2003
by
Kirk Webb
Browse files
Small bugfix to renew daemon.
parent
cc6d6fa7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tbsetup/plab/libplab.py.in
View file @
f11d59ba
...
...
@@ -594,14 +594,17 @@ class Plab:
from
signal
import
signal
,
alarm
,
SIGALRM
from
traceback
import
format_exception_only
from
xmlrpclib
import
Fault
# Setup alarm handler
class
TimeoutError
(
StandardError
):
pass
def
alrmhandler
(
signum
,
frame
):
raise
TimeoutError
signal
(
SIGALRM
,
alrmhandler
)
endtime
=
int
(
time
.
mktime
(
time
.
gmtime
()))
+
RENEW_TIME
res
=
DBQueryFatal
(
"select pid, eid, node_id from plab_slice_nodes"
" where %s > unix_timestamp(leaseend)"
,
(
endtime
,
))
loadedSlices
=
{}
class
TimeoutError
(
StandardError
):
pass
def
alrmhandler
(
signum
,
frame
):
raise
TimeoutError
signal
(
SIGALRM
,
alrmhandler
)
for
pid
,
eid
,
nodeid
in
res
:
try
:
slice
=
loadedSlices
[(
pid
,
eid
)]
...
...
@@ -609,10 +612,9 @@ class Plab:
slice
=
self
.
loadSlice
(
pid
,
eid
)
loadedSlices
[(
pid
,
eid
)]
=
slice
node
=
slice
.
loadNode
(
nodeid
)
alarm
(
RENEW_TIMEOUT
)
try
:
alarm
(
RENEW_TIMEOUT
)
node
.
renew
()
alarm
(
0
)
except
TimeoutError
:
print
"Timeout waiting for renewal of sliver %s"
%
nodeid
except
Fault
,
e
:
...
...
@@ -622,6 +624,7 @@ class Plab:
tb
=
""
.
join
(
format_exception_only
(
*
sys
.
exc_info
()[:
2
]))
print
"unknown exception while trying to renew %s
\n
%s"
%
\
(
nodeid
,
tb
)
alarm
(
0
)
def
_createAgentProxy
(
self
,
insecure
=
False
):
"""
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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