Skip to content

Instantly share code, notes, and snippets.

@illyar80
illyar80 / REPORT.md
Created July 8, 2026 17:45
TLA+ model of Celery Redis ETA + visibility timeout duplication bug

Redis ETA + Visibility Timeout Duplication in Celery

A formal TLA+ model of a race condition in Celery's Redis broker: when visibility_timeout expires before a worker acknowledges an ETA task, restore_visible creates a duplicate copy, leading to double execution.

The Bug

In Celery with Redis broker, each fetched task enters a "reserved" state (invisible to other workers) for visibility_timeout seconds. If the worker