SQLite C API hook (sqlite3_busy_handler) invoked whenever a connection fails to acquire the write lock. SQLite's shipped busy_timeout is one built-in implementation: a C algorithm using a 12-entry delays array that waits 1 ms the first time but grows to always waiting 100 ms after 12 iterations, so older queries are penalized relative to newer ones — producing long-tail p99.9 latency when writes are steady. Because the C timeout runs inside Ruby's process it holds the GVL, blocking other Puma workers from doing Ruby work during DB waits. Margheim's fix is to implement the busy_handler in Ruby using Kernel#sleep (which releases the GVL) and to make every retry a fair 1 ms wait. The fair Ruby implementation is in the sqlite3 gem main branch and aimed for Rails 8.