Commit 21e2cc88 authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Remove obsolete assertion



This code is scheduled to be removed any way (for a single job,
there is no point in managing a job queue) and the assertion does
not hold true any more in the new design. The problem with the
assertion is that it does not kill the process, so the job will
never be cleaned up. Hence remove the assertion and do a best effort
to get the job in an error state.
Signed-off-by: default avatarKlaus Aehlig <aehlig@google.com>
Reviewed-by: default avatarPetr Pudlak <pudlak@google.com>
parent 87eccd0a
......@@ -1081,19 +1081,14 @@ class _JobProcessor(object):
finalize = False
elif op.status == constants.OP_STATUS_ERROR:
# Ensure failed opcode has an exception as its result
assert errors.GetEncodedError(job.ops[opctx.index].result)
# If we get here, we cannot afford to check for any consistency
# any more, we just want to clean up.
# TODO: Actually, it wouldn't be a bad idea to start a timer
# here to kill the whole process.
to_encode = errors.OpExecError("Preceding opcode failed")
job.MarkUnfinishedOps(constants.OP_STATUS_ERROR,
_EncodeOpError(to_encode))
finalize = True
# Consistency check
assert compat.all(i.status == constants.OP_STATUS_ERROR and
errors.GetEncodedError(i.result)
for i in job.ops[opctx.index:])
elif op.status == constants.OP_STATUS_CANCELING:
job.MarkUnfinishedOps(constants.OP_STATUS_CANCELED,
"Job canceled by request")
......
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