← Graph

Don't Enqueue Jobs Inside A Transaction

takeaway 2 connections

A job enqueued inside a transaction may run before the transaction commits (seeing stale data or missing rows), or be committed to Redis even though the transaction later rolls back. Moving the enqueue to the end of the transaction is not a guaranteed fix. This has been a long-standing Sidekiq problem; Sidekiq 7 finally addresses it, making jobs queued at the end of a transaction wait until commit before executing.

type
warning
takeaway Don't Enqueue Jobs Inside A Transaction
about
Sidekiq tool
Describes a historical Sidekiq race condition fixed in Sidekiq 7.
takeaway Don't Enqueue Jobs Inside A Transaction
from_talk
Warning from the practices half of the talk.

Provenance