oban v1.0.0-rc.1 Release Notes
Release Date: 2020-01-21 // over 4 years ago-
Migration Required (V8)
๐ This is the first required migration since 0.8.0, released in 09/2019. It brings ๐ท with it a new column,
discarded_at
, a streamlined notifications trigger, job ๐ท prioritiy and job tags.โฌ๏ธ Upgrading only requires running the new migration.
First, generate a new migration:
mix ecto.gen.migration upgrade_oban_jobs_to_v8
Next, call
Oban.Migrations
in the generated migration:defmodule MyApp.Repo.Migrations.UpdateObanJobsToV8 do use Ecto.Migration def up, do: Oban.Migrations.up(version: 8) def down, do: Oban.Migrations.down() end
โฌ๏ธ Oban will manage upgrading to V8 regardless of the version your application is currently using, and it will roll back a single version.
โ Added
โฑ [Oban] Add
timezone
support for scheduling cronjobs using timezones other than "Etc/UTC". Using a custom timezone requires a timezone database such as tzdata.๐ง [Oban] Add
dispatch_cooldown
option to configure the minimum time between a producer fetching more jobs to execute.๐ง [Oban] Add
beats_maxage
option to configure how long heartbeat rows are retained in theoban_beats
table. Each queue generates one row per second, so rows may accumulate quickly. The default value is now five minutes, down from one hour previously.๐ท [Oban.Job] Add
discarded_at
timestamp to help identify jobs that were discarded and not completed. The timestamp is added by the V8 migration and it is also included in the originalcreate table
from V1 as a minor space saving optimization (packing datetime columns together because they use a predictable 4bytes of space).๐ท [Oban.Job] Add numerical
priority
value to control the order of execution for jobs within a queue. Thepriority
can be set between 0 and 3, with 0 being the default and the highest priority.๐ท [Oban.Job] Add
tags
field for arbitrarily organizing associated tags. Tags are a list of strings stored as anarray
in the database, making them easy to search and filter by.
๐ Changed
0๏ธโฃ [Oban] Change the default
prune
value from:disabled
to{:maxlen, 1_000}
. Many people don't change the default until they realize that a lot of jobs are lingering in the database. It is rare that anybody would want to keep all of their jobs forever, so a conservative default is better than:disabled
.[Oban] Change
oban_beats
retention from one hour to five minutes. The value is now configurable, with a default of300s
. The lower bound is60s
because we require one minute of heartbeat activity to rescue orphaned jobs.[Oban.Queue.Producer] Introduce "dispatch cooldown" as a way to debounce repeatedly fetching new jobs. Repeated fetching floods the producer's message queue and forces the producer to repeatedly fetch one job at a time, which is not especially efficient. Debounced fetching is much more efficient for the producer and the database, increasing maximum jobs/sec throughput so that it scales linearly with a queue's concurrency settings (up to what the database can handle).
๐ท [Oban.Query] Discard jobs that have exhausted the maximum attempts rather than rescuing them. This prevents repeatedly attempting a job that has consistently crashed the BEAM.
[Oban.Query] Use transactional locks to prevent duplicate inserts without relying on unique constraints in the database. This provides strong unique guarantees without requiring migrations.
โ Removed
- [Oban.Notifications] An overhauled and simplified insert trigger no longer
emits
update
notifications. This was largely an internal implementation detail and wasn't publicly documented, but it does effect the UI.