rails/activejob/test
Sam Bostock bc1f323338
Add ActiveJob::Serializers::BigDecimalSerializer
Previously, BigDecimal was listed as not needing a serializer.  However,
when used with an adapter storing the job arguments as JSON, it would get
serialized as a simple String, resulting in deserialization also producing
a String (instead of a BigDecimal).

By using a serializer, we ensure the round trip is safe.

During upgrade deployments of applications with multiple replicas making use of
BigDecimal job arguments with a queue adapter serializing to JSON, there exists
a possible race condition, whereby a "new" replica enqueues a job with an
argument serialized using `BigDecimalSerializer`, and an "old" replica fails to
deserialize it (as it does not have `BigDecimalSerializer`).

Therefore, to ensure safe upgrades, serialization will not use
`BigDecimalSerializer` until `config.active_job.use_big_decimal_serializer` is
enabled, which can be done safely after successful deployment of Rails 7.1.

This option will be removed in Rails 7.2, when it will become the default.
2022-07-19 15:31:41 -04:00
..
adapters Add missing requires 2022-02-17 11:13:51 +10:30
cases Add ActiveJob::Serializers::BigDecimalSerializer 2022-07-19 15:31:41 -04:00
integration add assertion helpers for Active Job integration 2022-01-26 19:41:45 -05:00
jobs Add ActiveJob::Serializers::BigDecimalSerializer 2022-07-19 15:31:41 -04:00
models [Active Job] rubocop -a --only Layout/EmptyLineAfterMagicComment 2017-07-11 13:12:32 +09:00
support Clear JobBuffer on teardown 2022-07-18 23:33:07 -04:00
helper.rb Removed deprecated behavior that was not halting after_enqueue/after_perform callbacks when a previous callback was halted with throw :abort. 2021-11-17 21:51:17 +00:00