[Oban] Support passing changeset streams to insert_all.
Accepting streams makes Oban.insert_all more flexible and may, in some circumstances, make it possible to reduce memory usage for streams of large resources.
Bug Fixes
[Config] Validate :repo option without checking for Ecto.Repo behaviour.
Repo wrappers that don't implement all functions of the Ecto.Repo behaviour are still viable and shouldn't be validated with a behaviour check. This changes repo validation back to the way it was done in older versions, by checking that it's a valid module that exports config/0.
[Peer] Handle rollback during Oban.Peers.Postgres peer election
Infrequently, the postgres peer election transaction returns {:error, :rollback}. Now that return value is handled to prevent a match error.
The peer maintains its current leader? status on rollback—this may cause inconsistency if the leader encounters an error and multiple rollbacks happen in sequence. That tradeoff is acceptable because the situation is unlikely and less of an issue than crashing the peer.
[Oban] Skip queue existence check for pause_all_queues and resume_all_queues when the local_only option is passed.
v2.17.1
Bug Fixes
[Validation] Restore validation helpers still used externally
Some of the internal validation helpers are needed by external packages that can't easily change to schema validation. This restores those essential validation functions.
v2.17.0
This release includes an optional database migration to disable triggers and relax priority checks. See the v2.17 upgrade guide for step-by-step instructions.
📟 Universal Insert Notifications
Historically, Oban used database triggers to emit a notification after a job is inserted. That allowed jobs to execute sooner, without waiting up to a second until the next poll event. Those triggers and subsequent notifications added some overhead to database operations bulk inserts into the same queue, despite deduplication logic in the trigger. Even worse, trigger notifications didn't work behind connection poolers and were restricted to the Postgres notifier.
Now insert notifications have moved out of the database and into application code, so it's possible to disable triggers without running database migrations, and they work for any notifier, not just Postgres.
Disable notifications with the insert_trigger option if sub-second job execution isn't important or you'd like to reduce PubSub chatter:
config :my_app, Oban,
insert_trigger: false,
...
🧑🏭 Worker Conveniences
Workers received a few quality of life improvements to make defining unique behaviour more expressive and intuitive.
First, it's now possible to define a job's unique period with time units like {1, :minute} or {2, :hours}, just like a job's :schedule_in option:
[Oban] Support passing changeset streams to insert_all.
Accepting streams makes Oban.insert_all more flexible and may, in some circumstances, make it
possible to reduce memory usage for streams of large resources.
Bug Fixes
[Config] Validate :repo option without checking for Ecto.Repo behaviour.
Repo wrappers that don't implement all functions of the Ecto.Repo behaviour are still viable and
shouldn't be validated with a behaviour check. This changes repo validation back to the way it
was done in older versions, by checking that it's a valid module that exports config/0.
[Peer] Handle rollback during Oban.Peers.Postgres peer election
Infrequently, the postgres peer election transaction returns {:error, :rollback}. Now that
return value is handled to prevent a match error.
The peer maintains its current leader? status on rollback—this may cause inconsistency if the
leader encounters an error and multiple rollbacks happen in sequence. That tradeoff is
acceptable because the situation is unlikely and less of an issue than crashing the peer.
[Oban] Skip queue existence check for pause_all_queues and resume_all_queues when the
local_only option is passed.
v2.17.1 — 2023-12-11
Bug Fixes
[Validation] Restore validation helpers still used externally
Some of the internal validation helpers are needed by external packages that can't easily change
to schema validation. This restores those essential validation functions.
v2.17.0 — 2023-12-08
Enhancements
[Oban] Add Oban.pause_all_queues/2 and Oban.resume_all_queues/2.
Pause and resume all queues with a single function call and a single notification signal, rather
than manually looping through all queues and issuing separate calls.
[Cron] Add non-raising Expression.parse/2 for use in Cron.parse/2 and shared validations.
Multiple locations used parse! and converted a raised exception into an error tuple. That was
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 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 from 2.13.5 to 2.17.2.
Release notes
Sourced from oban's releases.
... (truncated)
Changelog
Sourced from oban's changelog.
... (truncated)
Commits
a9abb6e
Release v2.17.2336724a
Validate repo without behaviour checke12d177
Support passing changeset streams to insert_alld53ca48
Handle rollback during postgres peer election9ffe4aa
Skip queue existence check for pause/resume all5e95c8f
Correct upgrade guide link in CHANGELOG52749bf
Release v2.17.14288e8b
Restore validation helpers still used externally3705af3
Release v2.17.02dd13fb
Bump ecto_sql from 3.11.0 to 3.11.1 (#997)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