oban v2.13.0 Release Notes

Release Date: 2022-07-22 // almost 2 years ago
  • ✨ Enhancements

    • 0️⃣ [Telemetry] Add encode option to make JSON encoding for attach_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 and insert_all/2,4.

    These are typically the Ecto's standard "Shared Options" such as log and timeout. Other engines, such as Pro's SmartEngine may support additional options.

    • 🔌 [Repo] Add aggregate/4 wrapper to facilitate aggregates from plugins or other extensions that use Oban.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 and meta 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:

    1. Removing the engine override within config and exposing a centralized engine lookup instead.
    2. 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