There's a lot of unnecessary contention on the dag lock when trying to find a task or vertex. Likewise, there's likely contention on Vertex locks. A lot of this is avoidable. One simple fix would be to make the dag / vertex etc available in Tasks.
appContext.getCurrentDag doesn't seem to be thread safe either.