$ the-wire · showcase
JRuby 10 loads Active Support again; retry_job honors deferred options
By RepoJournal · Filed · About Rails
Active Support now loads on JRuby 10 by checking for Ractor, and retry_job respects enqueue options when deferring, with rubocop bumped and json locked below 3.0.
JRuby 10 reports `RUBY_VERSION` as `4.0.0` but does not define the `Ractor` constant, so `ActiveSupport::Ractors` selected Ruby 4.0 behavior based only on the version and `active_support/core_ext` failed to load with `NameError: uninitialized constant ActiveSupport::Ractors::Ractor`. Active Support now uses Ractor-backed behavior only when Ractor is actually defined [1]. This is a breaking change only for JRuby 10 users, who will now load successfully.
`retry_job` used to lose enqueue options when the enqueue was deferred; it now respects them [2]. Also, `ExceptionWrapper` builds the backtrace lazily, since "Building the backtrace is expensive, and there's a decent chance we won't need it" [3].
Rails upgraded rubocop and temporarily locked `json < 3.0`, because everything works except the resque test suite, which needs a new `multi_json` release [4]. A test fix in `MessageSerializerTest` handles json 3.x, as `JSON.load` is no longer a vulnerability [5].
Action items
- → Upgrade Rails on JRuby before deploying to JRuby 10 rails/rails [immediate]
- → Review retry_job usage for deferred enqueue option handling rails/rails [plan]
- → Monitor the temporary json < 3.0 lock for when multi_json releases rails/rails [monitor]
References
- [1] Fix Active Support loading on JRuby without Ractor ↗ rails/rails
- [2] Fix retry_job to respect enqueue options when enqueue is deferred ↗ rails/rails
- [3] ExceptionWrapper: build backtrace lazily ↗ rails/rails
- [4] Upgrade rubocop ↗ rails/rails
- [5] Fix MessageSerializerTest to handle json 3.x ↗ rails/rails