Changelog History
Page 1
-
v2.13.3 Changes
September 07, 2022π Bug Fixes
- [Oban] Fix dialyzer for
insert/2
andinsert_all/2
, again.
The recent addition of a
@spec
forOban.insert/2
broke dialyzer in some situations. To prevent this regression in the future we now include a compiled module that exercises allOban.insert
function clauses for dialyzer. - [Oban] Fix dialyzer for
-
v2.13.2 Changes
August 19, 2022π Bug Fixes
- [Oban] Fix
insert/3
andinsert_all/3
when using options.
Multiple default arguments caused a conflict for function calls with options but without an Oban instance name, e.g.
Oban.insert(changeset, timeout: 500)
- [Reindexer] Fix the unused index repair query and correctly report errors.
Reindexing and deindexing would faily silently because the results weren't checked and no exceptions were raised.
- [Oban] Fix
-
v2.13.1 Changes
August 09, 2022π Bug Fixes
- [Oban] Expand
insert
/insert_all
typespecs for multi arity
This fixes dialyzer issues from the introduction of
opts
toOban.insert
andOban.insert_all
functions.- [Reindexer] Allow specifying timeouts for all queries
In some cases, applying
REINDEX INDEX CONCURRENTLY
on the indexesoban_jobs_args_index
, andoban_jobs_meta_index
takes more than the default value (15 seconds). This new option allows clients to specify other values than the default. - [Oban] Expand
-
v2.13.0 Changes
July 22, 2022β¨ Enhancements
- 0οΈβ£ [Telemetry] Add
encode
option to make JSON encoding forattach_default_logger/1
.
Now it's possible to use the default logger in applications that prefer structured logging or use a standard JSON log formatter.
- β± [Oban] Accept a
DateTime
for the:with_scheduled
option when draining.
When a
DateTime
is provided, drains all jobs scheduled up to, and including, that point in time.- [Oban] Accept extra options for
insert/2,4
andinsert_all/2,4
.
These are typically the Ecto's standard "Shared Options" such as
log
andtimeout
. Other engines, such as Pro'sSmartEngine
may support additional options.- π [Repo] Add
aggregate/4
wrapper to facilitate aggregates from plugins or other extensions that useOban.Repo
.
π Bug Fixes
[Oban] Prevent empty maps from matching non-empty maps during uniqueness checks.
β [Oban] Handle discarded and exhausted states for inline testing mode.
Previously, returning a
:discard
tuple or exhausting attempts would cause an error.- 0οΈβ£ [Peer] Default
leader?
check to false on peer timeout.
Timeouts should be rare, as they're symptoms of application/database overload. If leadership can't be established it's safe to assume an instance isn't leader and log a warning.
- π [Peer] Use node-specific lock requester id for Global peers.
Occasionally a peer module may hang while establishing leadership. In this case the peer isn't yet a leader, and we can fallback to
false
.[Config] Validate options only after applying normalizations.
[Migrations] Allow any viable
prefix
in migrations.[Reindexer] Drop invalid Oban indexes before reindexing again.
Table contention that occurs during concurrent reindexing may leave indexes in an invalid, and unusable state. Those indexes aren't used by Postgres and they take up disk space. Now the Reindexer will drop any invalid indexes before attempting to reindex.
- [Reindexer] Only rebuild
args
andmeta
GIN indexes concurrently.
The new
indexes
option can be used to override the reindexed indexes rather than the defaults.The other two standard indexes (primary key and compound fields) are BTREE based and not as subject to bloat.
- β
[Testing] Fix testing mode for
perform_job
and alt engines, e.g. Inline
A couple of changes enabled this compound fix:
- Removing the engine override within config and exposing a centralized engine lookup instead.
- Controlling post-execution db interaction with a new
ack
option for the Executor module.
π Deprecations
- [Oban] Soft replace discard with cancel return value (#730) [Parker Selbert]
π For changes prior to v2.13 see the v2.12 docs.
π [opc]: https://getoban.pro/docs/pro/changelog.html π [owc]: https://getoban.pro/docs/web/changelog.html
- 0οΈβ£ [Telemetry] Add
-
v2.12.1 Changes
May 24, 2022π Bug Fixes
- π· [BasicEngine] Never fetch jobs that have reached max attempts
This adds a safeguard to the
fetch_jobs
function to prevent ever hitting theattempt <= max_attempts
check constraint. Hitting the constraint causes the query to fail, which crashes the producer and starts an infinite loop of crashes. The previous commit should prevent this situation from ocurring at the "staging" level, but to be absolutely safe this change prevents it at the "fetching" level too.There is a very minor performance hit from this change because the query can no longer run as an index only scan. For systems with a modest number of available jobs the performance impact is indistinguishable.
- π [Plugins] Prevent unexpectedly modifying jobs selected by subqueries
Most applications don't run at a serializable isolation level. That allows subqueries to run within a transaction without having the conditions recheckedβonly predicates on
UPDATE
orDELETE
are re-checked, not on subqueries. That allows a race condition where rows may be updated without another evaluation.π² [Repo] Set
query_opts
inRepo.transaction
options to prevent loggingbegin
andcommit
events in development loggers.π [BasicEngine] Remove the
ORDER BY
clause from unique queries
The previous
ORDER BY id DESC
significantly hurts unique query performance when there are a lot of potential jobs to check. The ordering was originally added to make test cases predictable and isn't important for the actual behaviour of the unique check. -
v2.12.0 Changes
April 19, 2022β¨ Enhancements
π§ [Oban] Replace queue, plugin, and peer test configuration with a single
:testing
option. Now configuring Oban for testing only requires one change, setting the test mode to either:inline
or:manual
.:inline
βjobs execute immediately within the calling process and without touching the database. This mode is simple and may not be suitable for apps with complex jobs.:manual
βjobs are inserted into the database where they can be verified and executed when desired. This mode is more advanced and trades simplicity for flexibility.
β [Testing] Add
with_testing_mode/2
to temporarily change testing modes within the context of a function.
Once the application starts in a particular testing mode it can't be changed. That's inconvenient if you're running in
:inline
mode and don't want a particular job to execute inline.π§ [Config] Add
validate/1
to aid in testing dynamic Oban configuration.π [Config] Validate full plugin and queue options on init, without the need to start plugins or queues.
[Peers.Global] Add an alternate
:global
powered peer module.π [Plugin] A new
Oban.Plugin
behaviour formalizes starting and validating plugins. The behaviour is implemented by all plugins, and is the foundation of enhanced config validation.π [Plugin] Emit
[:oban, :plugin, :init]
event on init from every plugin.
π Bug Fixes
- π· [Executor ] Skip timeout check with an unknown worker
When the worker can't be resolved we don't need to check the timeout. Doing so prevents returning a helpful "unknown worker" message, and instead causes a function error for
nil.timeout/1
.- β
[Testing] Include
log
andprefix
in generated conf forperform_job
.
The opts, and subsequent conf, built for
perform_job
didn't include theprefix
orlog
options. That prevented functions that depend on a job'sconf
withinperform/1
from running with the correct options.π§ [Drainer] Retain the currently configured engine while draining a queue.
[Watchman] Skip pausing queues when shutdown is immediate. This prevents queue's from interacting with the database during short test runs.
π For changes prior to v2.12 see the v2.11 docs.
π [opc]: https://getoban.pro/docs/pro/changelog.html π [owc]: https://getoban.pro/docs/web/changelog.html
-
v2.11.2 Changes
February 25, 2022π Bug Fixes
- β± [Peer] Retain election schedule timing after a peer shuts down.
A bug in the Peer module's "down" handler overwrote the election scheduling interval to
0
. As soon as the leader crashed all other peers in the cluster would start trying to acquire leadership as fast as possible. That caused excessive database load and churn.In addition to the interval fix, this expands the scheduling interval to 30s, and warns on any unknown messages to aid debugging in the future.
- [Notifier.Postgres] Prevent crashing after reconnect.
The
handle_result
callback no longer sends an errorneous reply after a disconnection.- βοΈ [Job] Guard against typos and unknown options passed to
new/2
. Passing an unrecognized option, such as:scheduled_in
instead of:schedule_in
, will make a job invalid with a helpful base error.
Previously, passing an unknown option was silently ignored without any warning.
-
v2.11.1 Changes
February 24, 2022β¨ Enhancements
π§ [Oban] Validate the configured
repo
by checking forconfig/0
, rather than the more obscure__adapter__/0
callback. This change improves integration with Repo wrappers such asfly_postgres
.β [Cron] Expose
parse/1
to facilitate testing that cron expressions are valid and usable in a crontab.
π Bug Fixes
π§ [Notifier.Postgres] Overwrite configured repo name when configuring the long-lived Postgres connection.
[Lifeline] Fix rescuing when using a custom prefix. The previous implementation assumed that there was an
oban_jobs_state
enum in the public prefix.π· [Lifeline] Set
discarded_at
when discarding exhausted jobs.
-
v2.11.0 Changes
February 13, 2022β¨ Enhancements
- [Migration] Change the order of fields in the base index used for the primary Oban queries.
The new order is much faster for frequent queries such as scheduled job staging. Check the v2.11 upgrade guide for instructions on swapping the index in existing applications.
π· [Worker] Avoid spawning a separate task for workers that use timeouts.
π· [Engine] Add
insert_job
,insert_all_jobs
,retry_job
, andretry_all_jobs
as required callbacks for all engines.π [Oban] Raise more informative error messages for missing or malformed plugins.
Now missing plugins have a different error from invalid plugins or invalid options.
π [Telemetry] Normalize telemetry metadata for all engine operations:
- Include
changeset
forinsert
- Include
changesets
forinsert_all
- Include
job
forcomplete_job
,discard_job
, etc
- Include
[Repo] Include
[oban_conf: conf]
intelemetry_options
for all Repo operations.
With this change it's possible to differentiate between database calls made by Oban versus the rest of your application.
π Bug Fixes
- π· [Telemetry] Emit
discard
rather thanerror
events when a job exhausts all retries.
Previously
discard_job
was only called for manual discards, i.e., when a job returned:discard
or{:discard, reason}
. Discarding for exhausted attempts was done withinerror_job
in error cases.π· [Cron] Respect the current timezone for
@reboot
jobs. Previously,@reboot
expressions were evaluated on boot without the timezone applied. In that case the expression may not match the calculated time and jobs wouldn't trigger.[Cron] Delay CRON evaluation until the next minute after initialization. Now all cron scheduling ocurrs reliably at the top of the minute.
[Drainer] Introduce
discard
accumulator for draining results. Now exhausted jobs along with manual discards count as adiscard
rather than afailure
orsuccess
.[Oban] Expand changeset wrapper within multi function.
Previously,
Oban.insert_all
could handle a list of changesets, a wrapper map with a:changesets
key, or a function. However, the function had to return a list of changesets rather than a changeset wrapper. This was unexpected and made some multi's awkward.β± [Testing] Preserve
attempted_at/scheduled_at
inperform_job/3
rather than overwriting them with the current time.π [Oban] Include
false
as a viablequeue
orplugin
option in typespecs
π Deprecations
- π [Telemetry] Hard deprecate
Telemetry.span/3
, previously it was soft-deprecated.
Removals
- π [Telemetry] Remove circuit breaker event documentation because
:circuit
events aren't emitted anymore.
π For changes prior to v2.11 see the v2.10 docs.
π [opc]: https://getoban.pro/docs/pro/changelog.html π [owc]: https://getoban.pro/docs/web/changelog.html
-
v2.10.1 Changes
November 09, 2021β Removed
- π [Oban.Telemetry] Remove the customizable prefix for telemetry events in favor
of workarounds such as
keep/drop
in [Telemetry Metrics][tel-fil].
π [tel-fil]: https://hexdocs.pm/telemetry_metrics/Telemetry.Metrics.html#module-filtering-on-metadata
- π [Oban.Telemetry] Remove the customizable prefix for telemetry events in favor
of workarounds such as