oban v2.3.0 Release Notes
Release Date: 2020-11-06 // over 3 years ago-
Migration Required (V9)
๐ท Migration V9 brings the new
cancelled
state, acancelled_at
column, and jobmeta
.Older versions of PostgreSQL, prior to version 12, don't allow altering an enum within a transaction. If you're running an older version and want to prevent a table rewrite you can add the new cancelled at state before running the V9 migration.
Create a migration with
@disable_ddl_transaction true
declared and run the ๐ท commandALTER TYPE oban_job_state ADD VALUE IF NOT EXISTS 'cancelled'
. The V9 ๐ migration will see that the cancelled value exists and won't attempt to modify the enum.After you've sorted adding the
cancelled
state (or ignored the issue, because ๐ท you're either running PG >= 12 or don't have many jobs retained), generate a new migration:mix ecto.gen.migration upgrade_oban_jobs_to_v9
Next, call
Oban.Migrations
in the generated migration:defmodule MyApp.Repo.Migrations.UpdateObanJobsToV9 do use Ecto.Migration def up do Oban.Migrations.up(version: 9) end def down do Oban.Migrations.down(version: 9) end end
โฌ๏ธ Oban will manage upgrading to V9 regardless of the version your application is currently using, and it will roll back a single version.
โ Added
๐ท [Oban.Job] Add new
meta
field for storing arbitrary job data that isn't appropriate asargs
.๐ท [Oban.Job] Introduce a
cancelled
state, along with a newcancelled_at
timestamp field. Cancelling a job viaOban.cancel_job
(or via Oban Web) now marks the job ascancelled
rather thandiscarded
.๐ท [Oban.Worker] Add
from_string/1
for improved worker module resolution.๐ [Oban.Telemetry] Pass the full
job
schema in telemetry metadata, not only select fields. Individual fields such asargs
,worker
, etc. are still passed for backward compatibility. However, their use is deprecated and they are no longer documented.
๐ Fixed
[Oban.Notifier] Fix resolution of
Oban.Notifier
child process inOban.Notifier.listen/2
.๐ท [Oban.Queue.Producer] Fix cancelling jobs without a supervised process. In some circumstances, namely a hot code upgrade, the job's process could terminate without the producer tracking it and leave the job un-killable.
[Oban] Only convert invalid changesets into
ChangesetError
frominsert!
. This prevents unexpected errors wheninsert!
is called within a transaction after the transaction has rolled back.