All Versions
59
Latest Version
Avg Release Cycle
26 days
Latest Release
825 days ago

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.
  • v1.0.0-rc.1 Changes

    January 21, 2020

    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 the oban_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 original create 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. The priority 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 an array 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 of 300s. The lower bound is 60s 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 the unique options passed to Worker.new/2 would completely override the options stored by use 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 or crontab: nil to disable scheduling. This matches the queues 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

  • v0.12.0 Changes

    November 26, 2019

    Migration 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 and stop_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 to Oban.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, 2019

    Migration Optional (V6)

    ๐Ÿ‘ท Job id's greater than 2,147,483,647 (PG int limit) can't be inserted into the โš™ running array on oban_beats. The array that Ecto defines uses int instead of bigint, which can't store the larger integers. This migration changes the column type to bigint[], 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.
  • v0.10.1 Changes

    October 08, 2019

    ๐Ÿ”„ Changed

    • [Oban.Notifier] Replay oban_gossip notifications to subscribed processes.
  • v0.10.0 Changes

    October 03, 2019

    Migration 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 and scheduled_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 from true to false. Also, :verbose now accepts only false and standard logger levels. This change aims to prevent crashes due to conflicting levels when the repo's log level is set to false.

    ๐Ÿ›  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.
  • v0.9.0 Changes

    September 20, 2019

    โž• Added

    • [Oban] Add insert_all/2 and insert_all/4, corresponding to c:Ecto.Repo.insert_all/3 and Ecto.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 by Oban.insert_all/2,4 internally and is exposed for convenience.

    ๐Ÿ”„ Changed

    • ๐Ÿšš [Oban.Config] Remove the default queue value of [default: 10], which was overriden by Oban.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 and down 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 a scheduled_at timestamp. Previously the state was only set when schedule_in was used.

  • v0.8.1 Changes

    September 11, 2019

    ๐Ÿ”„ Changed

    • โช [Oban.Notifier] Restore the gossip macro and allow oban_gossip channel for notifications.

    ๐Ÿ›  Fixed

    • [Oban.Migrations] Prevent invalid up and down ranges when repeatedly migrating without specifying a version. This issue was seen when running all of the up migrations on a database from scratch, as there would be multiple oban migrations that simply delegated to up and down.