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:
parent
6293f35f11
commit
963330242f
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user