$ the-wire · showcase
Solid Queue stops retrying jobs it can't record, Rails trims Arel allocations
By RepoJournal · Filed · About Rails · Composed from the cited sources · methodology
Solid Queue fixes a MySQL failure loop where an oversized error message made a failed job requeue forever, while Rails and Arel land a batch of per-query allocation cuts.
Fit failed execution errors into size-limited error columns rails/solid_queue
On MySQL, `error` is a TEXT column capped at 65,535 bytes, and the old code truncated only the backtrace while budgeting from the raw message, so a message that was too large on its own, or that grew once JSON-escaped, raised ActiveRecord::ValueTooLong on save. The worker then hit FinalizationError and released the job back to ready, so it ran and failed again on the next worker indefinitely. T...
Fix in_batches with use_ranges keeping an ignored default_order rails/rails
`in_batches` already warns or raises through `act_on_ignored_order` and drops the explicit `order` from the ranged relations it yields, but it kept `default_order`, so every batch query still carried a pointless `ORDER BY`. Both are now dropped from the yielded relation; it follows up the earlier use_ranges work.
Reuse type map cache keys for PostgreSQL result columns rails/rails
Every PostgreSQL result column ran `type_map.fetch(oid, fmod, sql_type)`, and the `*args` Array served as the cache key, allocating one Array per column on every query even on a hit. Result columns always key on `[fmod, ""]`, so the type map now holds one frozen key per modifier, cleaned up in `register_type` and `clear`; resolved types are unchanged.
Pin json below 3 for Rails 7.1 and 8.0 rails/solid_queue
json 3 removed the `quirks_mode` option that Active Support 7.1 and 8.0 still pass to `JSON.generate`, so CI's `bundle update railties` pulling json 3 made serializing job arguments raise ArgumentError, killing the processes integration tests started and leaving those jobs to hang until the 15-minute timeout. The gem is now pinned below 3 for those Rails versions.
Build WhereClause#ast predicates in one pass rails/rails
Two more allocation cuts from the same effort: `WhereClause#ast` now skips empty-string predicates while wrapping SQL literals instead of subtracting them into a temporary Array, and Arel's `SelectManager#project`/`#order` and `Window#order`/`#partition` convert String and Symbol arguments in place. Same `eql?("")` check, same ordering, one fewer Array per call.