All Versions
Latest Version
Avg Release Cycle
26 days
Latest Release
629 days ago

Changelog History
Page 1

  • v2.13.3 Changes

    September 07, 2022

    πŸ› Bug Fixes

    • [Oban] Fix dialyzer for insert/2 and insert_all/2, again.

    The recent addition of a @spec for Oban.insert/2 broke dialyzer in some situations. To prevent this regression in the future we now include a compiled module that exercises all Oban.insert function clauses for dialyzer.

  • v2.13.2 Changes

    August 19, 2022

    πŸ› Bug Fixes

    • [Oban] Fix insert/3 and insert_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.

  • 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 to Oban.insert and Oban.insert_all functions.

    • [Reindexer] Allow specifying timeouts for all queries

    In some cases, applying REINDEX INDEX CONCURRENTLY on the indexes oban_jobs_args_index, and oban_jobs_meta_index takes more than the default value (15 seconds). This new option allows clients to specify other values than the default.

  • v2.13.0 Changes

    July 22, 2022

    ✨ 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]: 🌐 [owc]:

  • 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 the attempt <= 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 or DELETE are re-checked, not on subqueries. That allows a race condition where rows may be updated without another evaluation.

    • 🌲 [Repo] Set query_opts in Repo.transaction options to prevent logging begin and commit 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 and prefix in generated conf for perform_job.

    The opts, and subsequent conf, built for perform_job didn't include the prefix or log options. That prevented functions that depend on a job's conf within perform/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]: 🌐 [owc]:

  • 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 for config/0, rather than the more obscure __adapter__/0 callback. This change improves integration with Repo wrappers such as fly_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, and retry_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 for insert
      • Include changesets for insert_all
      • Include job for complete_job, discard_job, etc
    • [Repo] Include [oban_conf: conf] in telemetry_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 than error 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 within error_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 a discard rather than a failure or success.

    • [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 in perform_job/3 rather than overwriting them with the current time.

    • πŸ”Œ [Oban] Include false as a viable queue or plugin option in typespecs

    πŸ—„ Deprecations

    • πŸ—„ [Telemetry] Hard deprecate Telemetry.span/3, previously it was soft-deprecated.


    • πŸ“š [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]: 🌐 [owc]:

  • 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]: