mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 19:10:10 +00:00
Better isolate faults in the ipmi plugin
Previously, one ipmi failure would tank all consoles and commands. Now, at least console failures are isolated. Next stop is to isolate command failures, then fix up session recovery.
This commit is contained in:
parent
c537a124cf
commit
7709a52eda
@ -31,14 +31,17 @@ def _ipmi_evtloop():
|
||||
console.session.Session.register_handle_callback(pullchain[0],
|
||||
_process_chgs)
|
||||
while (1):
|
||||
if tmptimeout is not None:
|
||||
console.session.Session.wait_for_rsp(timeout=tmptimeout)
|
||||
tmptimeout = None
|
||||
else:
|
||||
console.session.Session.wait_for_rsp(timeout=600)
|
||||
while ipmiwaiters:
|
||||
waiter = ipmiwaiters.popleft()
|
||||
waiter.send()
|
||||
try:
|
||||
if tmptimeout is not None:
|
||||
console.session.Session.wait_for_rsp(timeout=tmptimeout)
|
||||
tmptimeout = None
|
||||
else:
|
||||
console.session.Session.wait_for_rsp(timeout=600)
|
||||
while ipmiwaiters:
|
||||
waiter = ipmiwaiters.popleft()
|
||||
waiter.send()
|
||||
except:
|
||||
print "Whoops, that was a doozy"
|
||||
|
||||
def _process_chgs(intline):
|
||||
#here we receive functions to run in our thread
|
||||
@ -48,15 +51,18 @@ def _process_chgs(intline):
|
||||
global chainpulled
|
||||
os.read(intline,1) # answer the bell
|
||||
chainpulled = False
|
||||
while ipmiq:
|
||||
cval = ipmiq.popleft()
|
||||
if hasattr(cval[0], '__call__'):
|
||||
if isinstance(cval[1], tuple):
|
||||
rv = cval[0](*cval[1])
|
||||
elif isinstance(cval[1], dict):
|
||||
rv = cval[0](**cval[1])
|
||||
if len(cval) > 2:
|
||||
cval[2](rv)
|
||||
try:
|
||||
while ipmiq:
|
||||
cval = ipmiq.popleft()
|
||||
if hasattr(cval[0], '__call__'):
|
||||
if isinstance(cval[1], tuple):
|
||||
rv = cval[0](*cval[1])
|
||||
elif isinstance(cval[1], dict):
|
||||
rv = cval[0](**cval[1])
|
||||
if len(cval) > 2:
|
||||
cval[2](rv)
|
||||
except: # assure the thread does not crash and burn
|
||||
print "should put in some debug data here..."
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user