Upgrading v1 to v2
GoodJob v2 introduces a new Advisory Lock key format that is different than the v1 advisory lock key format; it's therefore necessary to perform a simple, but staged production upgrade. If you are already using >= v1.12+ no other changes are necessary.
- Upgrade your production environment to
v1.99.xfollowing the minor version upgrade process, including database migrations.v1.99is a transitional release that is safely compatible with bothv1.xandv2.0.0because it uses bothv1- andv2-formatted advisory locks. - Address any deprecation warnings generated by
v1.99. - Upgrade your production environment to
v1.99.xtov2.0.xagain following the minor upgrade process.
Notable changes:**
- Renames
:async_serverexecution mode to:async; renames prior:asyncexecution mode to:async_all. - Sets default Development environment's execution mode to
:asyncwith disabled polling. - Excludes performing jobs from
enqueue_limit's count inGoodJob::ActiveJobExtensions::Concurrency. - Triggers
GoodJob.on_thread_errorfor unhandled ActiveJob exceptions. - Renames
GoodJob.reperform_jobs_on_standard_erroraccessor toGoodJob.retry_on_unhandled_error. - Renames
GoodJob::Adapter.shutdown(wait:)argument toGoodJob::Adapter.shutdown(timeout:). - Changes Advisory Lock key format from
good_jobs[ROW_ID]togood_jobs-[ACTIVE_JOB_ID]. - Expects presence of columns
good_jobs.active_job_id,good_jobs.concurrency_key,good_jobs.concurrency_key, andgood_jobs.retried_good_job_id.