Skip to content

rust/v0.4.0

Choose a tag to compare

@brandur brandur released this 27 Oct 00:59
· 6 commits to master since this release
4647e69

馃 River for Rust 0.4.0.

Added

  • Extend the unstable extension API with peer work hooks, resolved insertion options, and bounded producer claims. Post-insert callbacks now include existing unique duplicates, requested metadata, and duplicate flags. PR #1501.
  • Add optional pilot hooks for single-job, bulk, and cleaner-driven deletion. Hooks run within the deletion transaction and can extend or replace the standard deletion. PR #1502.
  • A worker cancels its job with a reason by returning JobCancelError, like River for Go's JobCancel(err). Anywhere in the worker error's source chain, it cancels the job whatever attempts it has left, skips the error handler, and records JobCancelError: <reason> on the attempt as Go does. WorkOutcome::Cancel still cancels without a reason. PR #1504.

Changed

  • Breaking: Resumable steps can no longer be nested. Calls fail before running child callbacks, preventing unreachable resume points and rolled-back parent checkpoints from being saved again. PR #1534.
  • Breaking: Attempt counts are now i32 instead of i16, like River for Go's int: JobRow::attempt and max_attempts, AttemptError::attempt and AttemptError::new, InsertOpts::max_attempts and with_max_attempts, InsertParams::max_attempts, ClientBuilder::default_max_attempts, MAX_ATTEMPTS_DEFAULT, and riverqueue-test's builders. On SQLite, which stores native integers, a job with more than 32,767 maximum attempts inserts and reads back unchanged, as in Go. On Postgres, whose columns are 16-bit, an insert clamps max_attempts to 32,767 like Go's drivers instead of failing. PR #1504.

Fixed

  • Preserve original error types through work-begin hooks and peer outcomes so error handlers can downcast them. A JobCancelError reported for a peer cancels it, matching worker cancellation. PR #1501.
  • Fail retries that omit a saved cursor-only step, while preserving their checkpoints for recovery. Jobs with an existing step marker retain their behavior, including legacy stale cursor entries. PR #1534.
  • Replace whole top-level metadata values on SQLite, including JSON null, matching Postgres. Completed resumable cursor steps no longer run again because of stale cursor entries. PR #1533.
  • Preserve first-step resumable cursors on failure and step progress on snooze. Transactional checkpoints no longer leak into deferred updates after rollback or a failed write; rolling back a successful checkpoint write may replay earlier unpersisted steps. PR #1521.

Security

  • Update locked TLS and constant-time comparison dependencies (rustls, rustls-webpki, webpki-roots, and ctutils) to address security advisories. PR #1505, PR #1527, PR #1521.