• Iustin Pop's avatar
    job queue: fix loss of finalized opcode result · 34327f51
    Iustin Pop authored
    Currently, unclean master daemon shutdown overwrites all of a job's
    opcode status and result with error/None. This is incorrect, since the
    any already finished opcode(s) should have their status and result
    preserved, and only not-yet-processed opcodes should be marked as
    ‘error’. Cancelling jobs between opcodes does the same (but this is not
    allowed currently by the code, so it's not as important as unclean
    This patch adds a new _QueuedJob function that only overwrites the
    status and result of finalized opcodes, which is then used in job queue
    init and in the cancel job functions. The patch also adds some comments
    and a new set constants in constants.py highlighting the finalized vs.
    non-finalized opcode statuses.
    Signed-off-by: default avatarIustin Pop <iustin@google.com>
    Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>