Rails: The Sharp Parts. lock Is Not a Mutex

lock looks like a one-line fix for concurrency bugs. It isn't. This article walks through eight failure modes, proves each one with forking tests, and shows what actually holds an invariant.