Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump oban from 2.13.5 to 2.18.0 #1394

Closed
wants to merge 1 commit into from

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jul 29, 2024

Bumps oban from 2.13.5 to 2.18.0.

Release notes

Sourced from oban's releases.

v2.18.0

🔭 Queue Shutdown Telemetry

A new queue shutdown event, [:oban, :queue, :shutdown], is emitted by each queue when it terminates. The event originates from the watchman process, which tracks the total ellapsed time from when termination starts to when all jobs complete or the allotted period is exhausted.

Any jobs that take longer than the :shutdown_grace_period (by default 15 seconds) are brutally killed and left as orphans. The ids of jobs left in an executing state are listed in the event's orphaned meta.

This also adds queue:shutdown logging to the default logger. Only queues that shutdown with orphaned jobs are logged, which makes it easier to detect orphaned jobs and which jobs were affected:

[
  message: "jobs were orphaned because they didn't finish executing in the allotted time",
  queue: "alpha",
  source: "oban",
  event: "queue:shutdown",
  ellapsed: 500,
  orphaned: [101, 102, 103]
]

🚚 Distributed PostgreSQL Support

It's now possible to run Oban in distributed PostgreSQL databases such as Yugabyte. This is made possible by a few simple changes to the Basic engine, and a new unlogged migration option.

Some PostgreSQL compatible databases don't support unlogged tables. Making oban_peers unlogged isn't a requirement for Oban to operate, so it can be disabled with a migration flag:

defmodule MyApp.Repo.Migrations.AddObanTables do
  use Ecto.Migration
def up do
Oban.Migration.up(version: 12, unlogged: false)
end
end

🧠 Job Observability

Job stop and exception telemetry now includes the reported memory and total reductions from the job's process. Values are pulled with Process.info/2 after the job executes and safely fall back to 0 in the event the process has crashed. Reductions are a rough proxy for CPU load, and the new measurements will make it easier to identify computationally expensive or memory hungry jobs.

In addition, thanks to the addition of Process.set_label in recent Elixir versions, the worker name is set as the job's process label. That makes it possible to identify which job is running in a pid via observer or live dashboard.

v2.18.0 — 2024-07-26

Enhancements

  • [Job] Support simple unique: true and unique: false declarations

... (truncated)

Changelog

Sourced from oban's changelog.

v2.18.0 — 2024-07-26

Enhancements

  • [Job] Support simple unique: true and unique: false declarations

    Uniqueness can now be enabled with unique: true and disabled with unique: false from job options or a worker definition. The unique: true option uses all the standard defaults, but sets the period to :infinity for compatibility with Oban Pro's new simple unique mode.

  • [Cron] Remove forced uniqueness when inserting scheduled jobs.

    Using uniqueness by default prevents being able to use the Cron plugin with databases that don't support uniqueness because of advisory locks. Luckily, uniqueness hasn't been necessary for safe cron insertion since leadership was introduced and scheduling changed to top-of-the-minute many versions ago.

  • [Engine] Introduce check_available/1 engine callback

    The check_available/1 callback allows engines to customize the query used to find jobs in the available state. That makes it possible for alternative engines, such Oban Pro's Smart engine, to check for available jobs in a fraction of the time with large queues.

  • [Peer] Add Oban.Peer.get_leader/2 for checking leadership

    The get_leader/2 function makes it possible to check which node is currently the leader regardless of the Peer implementation, and without having to query the database.

  • [Producer] Log a warning for unhandled producer messages.

    Some messages are falling through to the catch-all handle_info/2 clause. Previously, they were silently ignored and it degraded producer functionality because inactive jobs with dead pids were still tracked as running in the producer.

  • [Oban] Use structured messages for most logger warnings.

    A standard structure for warning logs makes it easier to search for errors or unhandled messages from Oban or a particular module.

Bug Fixes

  • [Job] Include all fields in the unique section of Job.t/0.

    The unique spec lacked types for both keys and timestamp keys.

  • [Basic] Remove materialized option from fetch_jobs/3.

    The MATERIALIZED clause for CTEs didn't make a meaningful difference in job fetching accuracy. In some situations it caused a performance regression (which is why it was removed from Pro's Smart engine a while ago).

... (truncated)

Commits
  • baf6851 Release v2.18.0
  • 0ef8021 Update testing_queues.md to be consistent with installation guide (#1121)
  • 78d9ee7 Accept enumerable output instead of exact stream
  • b6d83e6 Include process memory and reductions in telemetry
  • 7601b8e Add Oban.Peer.get_leader/2 for checking leadership
  • b36b963 Use structured messages for most logger warnings
  • d8b5fee Log a warning for unhandled producer messages
  • e63d60d Remove materialized option from Basic.fetch_jobs/3
  • 00ddc10 Remove forced unique from cron plugin
  • 4d43326 Merge oban_jobs table migrations
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [oban](https://github.com/sorentwo/oban) from 2.13.5 to 2.18.0.
- [Release notes](https://github.com/sorentwo/oban/releases)
- [Changelog](https://github.com/sorentwo/oban/blob/main/CHANGELOG.md)
- [Commits](oban-bg/oban@v2.13.5...v2.18.0)

---
updated-dependencies:
- dependency-name: oban
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code labels Jul 29, 2024
@dependabot dependabot bot requested a review from kkrug July 29, 2024 09:38
Copy link
Contributor Author

dependabot bot commented on behalf of github Aug 19, 2024

Superseded by #1411.

@dependabot dependabot bot closed this Aug 19, 2024
@dependabot dependabot bot deleted the dependabot/hex/production/oban-2.18.0 branch August 19, 2024 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file elixir Pull requests that update Elixir code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants