Skip to content

12.38.1

Choose a tag to compare

@timgit timgit released this 05 Nov 15:38
· 107 commits to master since this release

12.38.1

Schema version: 46, unchanged from 12.38.0

  • Fix: groupConcurrency could be exceeded when several fetches ran at once. Each one counted a group's active jobs without seeing the jobs the others had just claimed, so a group could go over its limit by up to the number of fetches running at once. A fetch now counts its groups again after its claim commits, and puts the jobs over the limit back to created before any handler sees them. Of two fetches that raced, at least the later one sees both claims. A fetch that puts back every job it claimed tries again after a short random pause, up to three tries.

    A job that the queue's policy refuses to put back, such as a stately key whose created slot filled after the claim, runs over the limit. The rest of the batch still goes back.

    fetch() with db, inside your own transaction, is not covered. Other fetches can't see its claim until that transaction commits, and it doesn't try again, since it would claim the jobs it just put back.

    Thanks to @shubrt for the report in #976 and to @shehjaddev for the fix in #983.

  • Fix: a daily or other hour-restricted cron schedule with a tz sent twice on the night the clocks go back, once at each of the repeated local times. It now sends once, which is what cron does and what previewSchedule() lists. A schedule that names every hour, like 0 * * * *, still sends in both repeated hours. The missed: 'once' catch-up follows the same rule. Thanks to @calpeyser for the fix in #985.

  • Fix: with a TestClock, pg-boss set up each new pool connection from the pool's connect event without waiting, so the first query on that connection queued behind the setup. pg 8 prints a deprecation warning for that ("Calling client.query() when the client is already executing a query"), and pg 9 removes the queue. The setup now runs in pg-pool's onConnect, which finishes before the connection is handed out. If the setup fails, the checkout fails with its error and the connection is closed, instead of the connection being handed out without it. Thanks to @KyleJune for the report in #986 and to @efeesrefinal for the fix in #991.

  • Fix: a worker timed its polling round with the clock passed to new PgBoss({ clock }), so setting a TestClock back during a round delayed the next poll by the same amount. Workers now time the round with the system clock. Job timestamps still use the configured clock. Thanks to @tolborg for the report in #987 and to @wood0v0 for the fix in #990.

  • Fix: the 12.38.0 type declarations referred to ResolvedConstructorOptions and CompatibilityFlags, which the build had left out, so a project that typechecks its dependencies (skipLibCheck: false) failed with TS2724. The published declarations include both. Thanks to @TinyQ for the report in #988.

PRs

  • fix: run session statements in pg-pool's onConnect by @efeesrefinal in #991
  • fix(worker): time the polling round with Date.now() by @wood0v0 in #990
  • fix(schedule): a daily cron schedule sends once on the night the clocks go back by @calpeyser in #985
  • fix(types): published declarations keep the resolved options type they name by @timgit in #992
  • fix: give back jobs claimed past groupConcurrency by concurrent fetches by @shehjaddev in #983
  • fix: a give-back the queue policy refuses keeps only that job past groupConcurrency by @timgit in #993

Full Changelog: 12.38.0...12.38.1