There's a race condition right after the if-branch has been taken. If the parent job's finished, this will add something to a waitlist key that will never get executed.