Skip to content

chore(deps): update dependency oban to v2.23.0#486

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/oban-2.x
Open

chore(deps): update dependency oban to v2.23.0#486
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/oban-2.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Apr 29, 2026

This PR contains the following updates:

Package Type Update Change
oban (source) prod minor 2.21.1== 2.23.0

Release Notes

oban-bg/oban (oban)

v2.23.0

Compare Source

Enhancements
  • [Job] Warn when unique :states leave lifecycle gaps

    Explicit :states lists are deprecated, but still exist in many applications. Lists that omit
    insert states like :scheduled, or :available silently fail to prevent duplicates at all.

    Partial state lists like [:available, :executing, :scheduled] leave gaps in the lifecycle
    where duplicates slip through or clog job staging.

    Workers defined with these patterns now warn at compile time with recommended changes for
    missing insert states or partial states.

  • [Producer] Jitter producer dispatch to prevent fetch conflicts

    Producers now apply jitter to the cooldown period between fetches. Without jitter, producers
    across nodes could synchronize on shared signals and stampede the database with simultaneous
    fetches.

    The configured cooldown is now the average wait rather than the minimum, with actual delays
    varying between roughly 1ms and 2x the configured value. For example, the default 5ms cooldown
    will range from 1ms to 10ms.

  • [Oban] Tune restart intensity to tolerate queue crashes

    The top level queue supervisor used the default restart strategy, so a single misbehaving queue
    exceeding that budget could crash every other queue alongside it. This increases the budget to
    20 restarts in 60 seconds so that an isolated queue fault stays isolated for longer.

  • [Producer] Replace drain polling with a pushed signal

    During queue shutdown, queues polled every 10ms until all jobs were finished. That competed for
    the producer's mailbox with the :DOWN messages it was waiting for and sent unnecessary
    messages. The producer now pushes a single message the moment running empties.

  • [Telemetry] Optionally scope the logging to a single instance

    Add an :oban_name option to attach_default_logger/1 and detach_default_logger/1. When set,
    multiple scoped loggers can coexist, and events from other instances are filtered out by
    matching the instance name. This is primarily useful for testing environments.

  • [Repo] Add exhausted logging to transaction/3

    Intermittent queries ran by autonomous processes like Pruner would crash and enter a restart
    loop when the database was unavailable longer than the retry budget. Under a sustained outage
    that could be enough to crash the entire supervision tree.

    A new :on_exhausted retry option now accepts :raise (the default) and :log, to output an
    error log rather than raising.

Bug Fixes
  • [Config] Break extra compile cycle by deferring default modules

    Reference default modules from Config.new/1 rather than as defstruct defaults. Inline module
    references in struct defaults created compile-time edges to modules that alias Config. That
    pulls 24 interconnected modules into a compile cycle.

  • [Errors] Extract Oban.Errors to prevent circular compile cycle

    A circular chain existed between backoff -> exceptions -> job -> worker, which caused an extra
    compilation cycle.

  • [Repo] Consolidate UndefinedFunctionError retry in transaction/3

    Move UndefinedFunctionError retry into transaction/3's rescue alongside database errors so
    retry, backoff, and :on_exhausted semantics apply uniformly.

  • [Repo] Retry MyXQL deadlock and lock-wait-timeout errors

    Treat the MyXQL error codes 1213 (deadlock) and 1205 (lock wait timeout) as expected
    conflicts so transactions retry on the "fast path". Previously, only Postgres conflicts
    qualified, so MySQL deadlocks fell through to the slow unexpected-error retry.

  • [Cron] Skip ahead by a full day on weekday mismatch

    This is a performance enhancement for expressions that use specific weekdays. Resolution
    previously advanced by minute through every hour of every intervening day before reaching the
    next valid weekday. They now jump directly to the next matching day, making expressions like
    */5 * * * 1 resolve in a handful of steps instead of thousands.

  • [Producer] Ignore stray :DOWN messages for released refs

    When a job's task finishes successfully its ref is demonitored, but a late :DOWN can still
    arrive if the message was sitting in the mailbox before demonitor ran.

    Now the down handler clause is guarded so the producer survives.

  • [Migration] Tolerate non-numeric migration versions

    Custom migrators, like Oban Pro's DynamicPartitioner, record a comment on the oban_jobs
    table to indicate the version is managed externally. Parsing that as an integer crashed
    application startup during validation in testing modes.

  • [Peer] Update callback arities to match actual call sites

    The leader? and get_leader callbacks were declared at arity 1, but they're always invoked as
    arity 2 with a timeout. Implementing the documented arity wasn't viable, and mocking libraries
    like Mox couldn't generate a usable mock.

    Correct the callback specs to leader?/2 and get_leader/2 so the behaviour matches reality.

  • [Validator] Tighten fallthroughs in validation

    Each type clause now matches the success case positively and falls to an explicit error clause,
    so values that previously slipped past a negative guard and into the :ok catch-all are
    properly rejected.

v2.22.1

Compare Source

Bug Fixes
  • [Repo] Conditionally reference database driver errors

    The retryable_exceptions macro previously hard-coded references to MyXQL.Error and
    Postgrex.Error, which Elixir v1.20.0.rc.2+ flags as missing module references at macro
    expansion time when the corresponding driver isn't a project dependency. The missing module
    reference could escalate into a deadlock, and compilation would halt entirely.

    Driver error lists are now resolved at compile time and only include modules that are actually
    loaded, so projects using Postgrex without MyXQL (or vice versa) compile cleanly.

  • [Cron] Reject impossible combinations in cron expressions

    Cron strings whose day and month fields could never align (e.g. "0 0 30 2 *", or "0 0 31 4 *")
    parsed, but caused next_at/2 and last_at/2 to loop indefinitely.

    Now expressions are validated to ensure at least one day fits within the maximum length of at
    least one selected month.

  • [Cron] Validate cron range bounds before expansion

    Range parts like 0-99999999 were accepted and expanded into the full integer range before the
    out-of-bounds check fired. For sufficiently large upper bounds that could stall the BEAM and
    risk OOM. The same path was reachable via the step variant 0-99999999/1 and the open-ended form
    9999999/1.

    Expression parsing now compares against the field's allowed min/max and rejects out-of-range
    values before any range is materialized.

  • [Migration] Fix prefix escaping in Postgres migrations

    Switch to the standard doubled-quote escape so it works under default Postgres configuration.

    The escaped_prefix value was using \' to escape single quotes, which hasn't been enabled by
    default since 9.1. Under default settings, the backslash was treated literally and the quote
    terminated the string, allowing a crafted prefix to break out of the SQL literal in
    migrated_version/1 and the notify trigger bodies.

  • [Backoff] Narrow with_retry exit catch to :timeout

    Exits never carry a database error module atom in the first tuple
    element. Connection failures surface as raised database exceptions,
    which the rescue clause above already handles. The catch now only
    matches :exit, {:timeout, _}, the one shape that's actually reachable.

v2.22.0

Compare Source

Enhancements
  • [Oban] Add Oban.all_jobs/2 and Oban.Job.query/1

    Introduce Oban.Job.query/1, a keyword-based builder that composes Ecto queryable from a small
    set of field filters. Scalar values become equality matches, lists become IN matches, atoms
    are coerced, and args or meta are compiled to a containment check.

    That pairs with Oban.all_jobs/2, a thin function that runs any queryable through the
    configured repo.

  • [Oban] Verify migrations at startup in testing mode

    When Oban starts in a testing mode, it now verifies that migrations have been run and are up to
    date. This catches migration issues early in CI rather than failing with confusing database
    errors during test execution or worse, in production.

    For Postgres, the check verifies the migration version is current, while for SQLite and MySQL,
    the check verifies the oban_jobs table exists.

  • [Sonar] Reduce ping rate with status-aware intervals

    Sonar previously pinged every 5s regardless of cluster state, which is aggressive for systems
    where nothing is changing. It now walks between a min and max interval, resetting on any status
    change and otherwise backing off toward a status driven target:

    • :clustered scales with peer count so aggregate traffic stays ~1 ping per min_interval
      regardless of cluster size
    • :solitary drifts to the max interval, since its only job is verifying the notifier channel
    • :isolated and :unknown stay at min_interval to keep recovery probes

    Stale-node pruning now uses an absolute window (default 120s) instead of a multiple of the
    current interval, and scheduled pings are jittered to avoid synchronizing nodes.

  • [Repo] The Repo retry behavior is now compile-time configurable, partially for
    testing purposes, but also to allow tweaking the internal retry behavior
    based on system requirements.

  • [Repo] Allow disabling transaction/3 retries

    Pass retry: 0 or retry: false to skip retries entirely, including for expected conflicts
    like deadlocks and serialization failures. This is intended for callers invoking queries like
    Oban.insert/2 from within an existing transaction, where a retry inside a savepoint would mask
    the real error from the outer transaction.

Bug Fixes
  • [Stager] Notify queues regardless of staging success

    When stage_jobs/3 raises a non-recoverable exception (e.g. a unique constraint violation), the
    wrapping transaction rolls back and the queue notification never fires. Pre-existing available
    jobs would then sit until the stager either recovered or the cluster was restarted.

    The stager now falls back to notifying queues outside the failed transaction, preferring the
    configured global path so the whole cluster is reached, and dropping to a local registry notify
    if the database itself is unreachable.

  • [Testing] Include suspended jobs in test helper queries

    The query used by test helpers like all_enqueued/0,1 now includes suspended jobs in addition
    to available and scheduled states.

  • [Repo] Tolerate unavailable Repo modules from all operations

    In development using containers, where recompiles take several seconds, the repo module can be
    purged and not-yet-reloaded for long enough that multiple Stager ticks occur. Each tick may
    crash with UndefinedFunctionError, blowing through the supervisor's restart quota.

    The Repo now rescues UndefinedFunctionError alongside the existing connection errors.

  • [Notifier] Fix duplicate pid accumulation in Postgres notifier

    Registering from the same process multiple times would accumulate duplicate pids in the Postgres
    notifier. Listening was deduplicated, but process registration wasn't.


Configuration

📅 Schedule: (in timezone America/New_York)

  • Branch creation
    • Between 12:00 AM and 03:59 AM (* 0-3 * * *)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot force-pushed the renovate/oban-2.x branch from 4c597aa to 00b3246 Compare May 1, 2026 16:15
@renovate renovate Bot changed the title chore(deps): update dependency oban to v2.22.0 chore(deps): update dependency oban to v2.22.1 May 1, 2026
@renovate renovate Bot force-pushed the renovate/oban-2.x branch from 00b3246 to bca4229 Compare May 6, 2026 15:28
@renovate renovate Bot force-pushed the renovate/oban-2.x branch from bca4229 to 1fc5e09 Compare May 18, 2026 11:01
@renovate renovate Bot changed the title chore(deps): update dependency oban to v2.22.1 chore(deps): update dependency oban to v2.23.0 May 27, 2026
@renovate renovate Bot force-pushed the renovate/oban-2.x branch from 1fc5e09 to 8a7c92b Compare May 27, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants