• Michael Hanselmann's avatar
    jqueue: Fix deadlock between job queue and dependency manager · 37d76f1e
    Michael Hanselmann authored
    When an opcode is about to be processed its dependencies are
    evaluated using “_JobDependencyManager.CheckAndRegister”. Due
    to its nature that function requires a lock on the manager's
    internal structures. All of this happens while the job queue
    lock is held in shared mode (required for the job processor).
    When a job has been processed any pending dependencies are re-added
    to the job workerpool. Before this patch that would require
    the manager's lock and then, for adding the jobs, the job queue
    lock. Since this is in reverse order it will lead to deadlocks.
    Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
    Reviewed-by: default avatarIustin Pop <iustin@google.com>
jqueue.py 71.8 KB