Commit 0db7ac4d authored by Guido Trotter's avatar Guido Trotter
Browse files

Handle any exception in ganeti-masterd

If an uncaught exception is thrown currently it destroys the calling
thread. This patch changes the behaviour to failing the current job,
logging a message, but trying to keep the daemon up.

Reviewed-by: imsnah
parent 95e4a814
......@@ -288,6 +288,15 @@ def PoolWorker(worker_id, incoming_queue):
msg = "ganeti exception %s" % err
item.SetStatus(opcodes.Job.STATUS_FAIL, result=[msg])
print msg
except Exception, err:
msg = "unhandled exception %s" % err
item.SetStatus(opcodes.Job.STATUS_FAIL, result=[msg])
print msg
except:
msg = "unhandled unknown exception"
item.SetStatus(opcodes.Job.STATUS_FAIL, result=[msg])
print msg
finally:
#utils.Unlock('cmd')
#utils.LockCleanup()
......
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