Skip to content

fix: make celery broker SQS visibility timeout configurable, default 30m - #40

Open
ividito wants to merge 1 commit into
feat/airflow-3-upgradefrom
fix/sqs-visibility-timeout
Open

fix: make celery broker SQS visibility timeout configurable, default 30m#40
ividito wants to merge 1 commit into
feat/airflow-3-upgradefrom
fix/sqs-visibility-timeout

Conversation

@ividito

@ividito ividito commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Increase SQS timeout threshold to prevent long-running tasks from failing. This is configurable, and defaults to 30m (the longest impacted task I found in our dev environment was 11m, so this is generous).

aws_sqs_queue.celery_broker set no visibility_timeout_seconds, so the AWS
provider default of 30s applied. Any Airflow task running longer than 30s had
its broker message redelivered mid-run, and a second worker tried to start the
same task instance.

On Airflow 2 the duplicate delivery was tolerated. On Airflow 3 the Task
Execution API rejects the second start with `invalid_state`, the Celery executor
reports the task as failed, and the scheduler kills the still-healthy original
run - the task fails despite never having errored.

This has to be fixed on the queue rather than through celery's
broker_transport_options, because the Airflow config uses `predefined_queues`:
kombu does not create the queue, so the queue's own attribute governs
redelivery.

Observed on sm2a-dev and sm2a-sit (both Airflow 3.0.2): a vector ingest task
failed at the 30s mark while actively processing, having succeeded at ~11
minutes on 2.10.5.

Exposed as celery_broker_visibility_timeout_seconds. The new 1800s default
changes the queue attribute for existing consumers on next apply; this is an
in-place SetQueueAttributes update and does not replace the queue.
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.

1 participant