Rails Connection Pool Exhaustion: Fixing ActiveRecord::ConnectionTimeoutError
ActiveRecord::
The database is the one place in a Rails system that can settle a race correctly, which is exactly why so much reliability work ends up here. This hub covers Postgres locking, transactions and isolation levels, unique constraints, and the atomic state transitions that let exactly one worker win.
Start here
Why read-modify-write leaks race conditions in Rails, how SELECT FOR UPDATE blocks, and when to use advisory locks — with real production code.
More articles
ActiveRecord::
Why Postgres kills one transaction on a deadlock, how to read the 40P01 log, the lock-ordering rule that prevents it, and the SQL to diagnose it live.