Changelog History
Page 5
-
v1.0.0-rc.2 Changes
January 22, 2020๐ Fixed
- [Oban.Migration] Separate adding and modifying new columns in the V8
migration. The columns can't be modified without a
flush
.
๐ Changed
- โ [Oban.Testing] Accept a custom prefix when making test assertions.
- [Oban.Migration] Separate adding and modifying new columns in the V8
migration. The columns can't be modified without a
-
v1.0.0-rc.1 Changes
January 21, 2020Migration 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.
-
v0.12.1 Changes
December 13, 2019๐ Fixed
- ๐ [Oban.Worker] Deep merge
unique
options between the worker and custom params. Previously theunique
options passed toWorker.new/2
would completely override the options stored byuse Oban.Worker
. This was primarily an issue for crontab jobs, where the period is always passed by the scheduler.
๐ Changed
โฑ [Oban] Allow setting
crontab: false
orcrontab: nil
to disable scheduling. This matches thequeues
behavior and makes it possible to override the default configuration within each environment, i.e. when testing.โ [Oban.Testing] Better error message for
Oban.Testing.assert_enqueued/2
- ๐ [Oban.Worker] Deep merge
-
v0.12.0 Changes
November 26, 2019Migration Optional (V7)
The queries used to prune by limit and age are written to utilize a single ๐ partial index for a huge performance boost on large tables. The new V7 migration will create the index for youโbut that may not be ideal for tables with millions ๐ท of completed or discarded jobs because it can't be done concurrently.
๐ท If you have an extremely large jobs table you can add the index concurrently in a dedicated migration:
create index( :oban_jobs, ["attempted_at desc", :id], where: "state in ('completed', 'discarded')", name: :oban_jobs_attempted_at_id_index, concurrently: true )
โ Added
[Oban] Add
start_queue/3
andstop_queue/2
for dynamically starting and stopping supervised queues across nodes.[Oban] Add
drain_queue/3
to accept drain options.with_scheduled: true
allows draining scheduled jobs.[Oban] Expose
circuit_backoff
as a "twiddly" option that controls how long tripped circuit breakers wait until re-opening.โ [Oban.Testing] Accept a value/delta tuple for testing timestamp fields. This allows more robust testing of timestamps such as
scheduled_at
.[Oban.Telemetry] Emit
[:oban, :trip_circuit]
and[:oban, :open_circuit]
events for circuit breaker activity. Previously an error was logged when the circuit was tripped, but there wasn't any way to monitor circuit breakers.
Circuit breaker activity is logged by the default telemetry logger (both
:trip_circuit
and:open_circuit
events).๐ Fixed
[Oban.Query] Avoid using prepared statements for all unique queries. This forces Postgres to use a custom plan (which utilizes the compound index) rather than falling back to a generic plan.
๐ท [Oban.Job] Include all permitted fields when converting a Job to a map, preserving any optional values that were either specified by the user or came via Worker defaults.
[Oban.Migrations] Guard against missing migration modules in federated environments.
๐ Changed
[Oban] Allow the multi
name
provided toOban.insert/3,4
to be any term, not just an atom.[Oban.Query] Use a consistent and more performant set of queries for pruning. Both pruning methods are optimized to utilize a single partial index.
-
v0.11.1 Changes
November 13, 2019๐ Fixed
[Oban.Pruner] Apply
prune_limit
when pruning beats. A lot of beats can accumulate when pruning has been disabled. Later, when pruning is enabled, the pruner would try to delete too many beats and would time out.โฑ [Oban.Crontab.Scheduler] Use a zero arity function for the transaction callback. The one arity version is only available in Ecto >= 3.2.
-
v0.11.0 Changes
November 06, 2019Migration Optional (V6)
๐ท Job id's greater than 2,147,483,647 (PG
int
limit) can't be inserted into the โ running array onoban_beats
. The array that Ecto defines usesint
instead ofbigint
, which can't store the larger integers. This migration changes the column type tobigint[]
, a locking operation that may take a few seconds.โ Added
- ๐ท [Oban] Added
crontab
support for automatically enqueuing jobs on a fixed schedule. A combination of transactional locks and unique jobs prevents scheduling duplicate jobs.
๐ Fixed
๐ท [Oban.Migrations] Add a comment when migrating
oban_jobs
to V5 and when rolling back down to V4.๐ง [Oban.Query] Apply the configured log level to unique queries.
[Oban.Notifier] Prevent open connections from accumulating when the circuit is tripped during the connection phase. This change may leave notifications in a state where they aren't listening to all channels.
๐ Changed
- โก๏ธ [Oban.Notifier] Replay
oban_update
notifications to subscribed processes.
- ๐ท [Oban] Added
-
v0.10.1 Changes
October 08, 2019๐ Changed
- [Oban.Notifier] Replay
oban_gossip
notifications to subscribed processes.
- [Oban.Notifier] Replay
-
v0.10.0 Changes
October 03, 2019Migration Optional (V5)
Tables with a lot of available jobs (hundreds of thousands to several million) โก๏ธ are prone to time outs when fetching new jobs. The planner fails to optimize โฑ using the index available on
queue
,state
andscheduled_at
, forcing both a slow sort pass and an expensive bitmap heap scan.This migration drops the separate indexes in favor of a a single composite index. The resulting query is up to 258,757x faster on large tables while ๐ง still usable for all of the other maintenance queries.
โก๏ธ History of the
EXPLAIN ANALYZE
output as the query was optimized is available here: https://explain.depesz.com/s/9Vh7๐ Changed
- 0๏ธโฃ [Oban.Config] Change the default for
verbose
fromtrue
tofalse
. Also,:verbose
now accepts onlyfalse
and standard logger levels. This change aims to prevent crashes due to conflicting levels when the repo's log level is set tofalse
.
๐ Fixed
- [Oban.Notifier] Restructure the notifier in order to to isolate producers from connection failures. Errors or loss of connectivity in the notification connection no longer kills the notifier and has no effect on the producers.
- 0๏ธโฃ [Oban.Config] Change the default for
-
v0.9.0 Changes
September 20, 2019โ Added
[Oban] Add
insert_all/2
andinsert_all/4
, corresponding toc:Ecto.Repo.insert_all/3
andEcto.Multi.insert_all/5
, respectively.๐ท [Oban.Job] Add
to_map/1
for converting a changeset into a map suitable for database insertion. This is used byOban.insert_all/2,4
internally and is exposed for convenience.
๐ Changed
๐ [Oban.Config] Remove the default queue value of
[default: 10]
, which was overriden byOban.start_link/1
anyhow.๐ฒ [Oban.Telemetry] Allow the log level to be customized when attaching the default logger. The default level is
:info
, the same as it was before.
๐ Fixed
[Oban.Migrations] Prevent invalid
up
anddown
targets when attempting to run migrations that have already been ran. This was primarily an issue in CI, where the initial migration was unscoped and would migrate to the current version while a subsequent migration would attempt to migrate to a lower version.0๏ธโฃ [Oban.Job] Prevent a queue comparison with
nil
by retaining the default queue (default
) when building uniqueness checks.โฑ [Oban.Job] Set state to
scheduled
for jobs created with ascheduled_at
timestamp. Previously the state was only set whenschedule_in
was used.
-
v0.8.1 Changes
September 11, 2019๐ Changed
- โช [Oban.Notifier] Restore the
gossip
macro and allowoban_gossip
channel for notifications.
๐ Fixed
- [Oban.Migrations] Prevent invalid
up
anddown
ranges when repeatedly migrating without specifying a version. This issue was seen when running all of theup
migrations on a database from scratch, as there would be multiple oban migrations that simply delegated toup
anddown
.
- โช [Oban.Notifier] Restore the