Ensure example abandons job when it fails

If a worker can't finish a job and the worker has not
crashed it should make sure that it manually abandons
the job that it claimed (if it crashes this release will
happen automatically).

Change-Id: I2d6894281915fd335bffa34c006aed023e88e9fc
This commit is contained in:
Joshua Harlow 2014-04-17 10:45:45 -07:00
parent 6293f35f11
commit 963330242f

View File

@ -145,6 +145,7 @@ might look like:
perform_job(my_job) perform_job(my_job)
except Exception: except Exception:
LOG.exception("I failed performing job: %s", my_job) LOG.exception("I failed performing job: %s", my_job)
board.abandon(my_job, my_name)
else: else:
# I finished it, now cleanup. # I finished it, now cleanup.
board.consume(my_job) board.consume(my_job)