The Wire · Showcase
RAILS 8 LAZY ROUTES NOW THREAD-SAFE, SOLID QUEUE ADDS MIGRATION GENERATOR
By RepoJournal · Filed · About Rails
A race condition in Rails 8's deferred route loading could serve 404s on valid routes under concurrent requests, and a fix landed overnight.
The threading bug [1] hit development and test environments where `config.eager_load` is false. Two requests arriving simultaneously could dispatch against a half-drawn route set, causing 404s or undefined method errors on url helpers. The fix wraps route drawing in a Monitor so concurrent requests wait for the draw to finish before dispatch [2]. On the Solid Queue front, a new update generator [3] landed to copy migrations from the gem into your app, laying groundwork for shipping schema changes as optional migrations now and required in the next major version. The generator respects your database configuration via the `--database` option. Separately, Solid Queue's integration tests were leaking job threads and suffering from signal timing races [4]. The test suite now waits deterministically for jobs to actually finish and transitions to complete before signaling QUIT and KILL, eliminating the flakes that hit CI recently. The website team published a curated reference apps library [5] on `/docs/reference-apps`, featuring three production-quality 37signals apps (Campfire, Writebook, Fizzy) with screenshots and metadata driven by a single YAML file.
One email a day. Unsubscribe in one click.
Keep up with Rails in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Upgrade Rails to pick up the thread-safe route loading fix if running 8.0+ rails/rails [immediate]
- → Run `bin/rails solid_queue:update` on next deploy to copy new migrations rails/solid_queue [plan]
- → Monitor CI stability on solid_queue; test flakes should drop significantly rails/solid_queue [monitor]
References
- [1] Make lazy route loading thread-safe ↗ rails/rails
- [2] Merge pull request #58225 from grk/thread-safe-lazy-route-loading rails/rails
- [3] Add an update generator to copy new migrations ↗ rails/solid_queue
- [4] Fix flaky tests caused by leaked job threads and signal timing ↗ rails/solid_queue
- [5] Add curated Reference Apps library ↗ rails/website