Ruby on Rails: Connection Management and Storage Fixes
Rails merged 20 pull requests addressing critical connection leaks in PostgreSQL adapters, Active Storage integrity issues, and optimistic locking problems. Key fixes include thread pool cleanup after parallel tests and fiber isolation improvements for concurrent applications.
Duration: PT2M8S
Transcript
Good morning. This is your Ruby on Rails development briefing for May 22nd, 2026.
Yesterday's activity included 20 merged pull requests and 26 additional commits focusing on connection management and storage reliability.
g-pavlik merged a fix preventing lock version bumps during blob analysis. This resolves ActiveRecord::StaleObjectError exceptions when users edit forms during the brief window between file attachment and analysis. The change modifies ActiveStorage::AnalyzeJob to avoid cascading touches to parent records with optimistic locking.
yahonda addressed PostgreSQL connection leaks with two critical fixes. The first disconnects test-local adapters to prevent "too many clients already" errors in nightly CI builds. The second ensures LoadAsync thread pool tests run on replaced pools rather than leaking connections.
ruyrocha fixed Active Record Pool Reaper thread leaks after parallelized test shutdowns. Long-lived CI processes running sequential suites were accumulating threads and database connections indefinitely.
joeljunstrom resolved ShareLock ownership issues under fiber isolation. When config.active_support.isolation_level is set to fiber, the reloader interlock was failing because all request fibers appeared as a single owner, allowing reload operations to clear constants mid-request.
Mordorreal improved Active Storage's MirrorService with two enhancements: fixing IntegrityError exceptions with nil checksums when track_variants is false, and parallelizing existence checks and uploads across mirror services for better performance.
Additional notable merges include fixes for duplicate where conditions in create_or_find_by, label-for-input ID mismatches with nil collection values, and SafeBuffer encoding preservation in MessagePack serialization.
What's next: Monitor the PostgreSQL connection leak fixes in nightly CI builds and test fiber isolation improvements under production workloads.
That's your Rails update for today. Back to building.