They really aren't locks at all, they're a cycle detector. Also rename REDO_LOCKS to a more meaningful REDO_CYCLES. And we'll move the CyclicDependencyError exception in here as well, instead of state.py where it doesn't really belong.