oban v2.12.0 Release Notes

Release Date: 2022-04-19 // 29 days ago
  • โœจ 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]: https://getoban.pro/docs/pro/changelog.html ๐ŸŒ [owc]: https://getoban.pro/docs/web/changelog.html

Previous changes from v2.11.2

  • ๐Ÿ› 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.