fix: warn about hardcoded 24h visibility_timeout that kills long-running Celery tasks - #62869
Merged
Conversation
YoannAbriel
requested review from
dheerajturaga and
hussein-awala
as code owners
March 4, 2026 13:10
YoannAbriel
force-pushed
the
fix/issue-62218
branch
15 times, most recently
from
March 8, 2026 19:04
5b78279 to
a3dfb2f
Compare
…ing Celery tasks Add a warning log when the default visibility_timeout of 86400 seconds (24 hours) is applied for Redis/SQS brokers, so users with long-running tasks know to increase it. Fix misleading task_acks_late documentation that incorrectly claimed it overrides visibility_timeout (it does not for Redis/SQS brokers). Fixes apache#62218
YoannAbriel
force-pushed
the
fix/issue-62218
branch
from
March 9, 2026 16:03
a3dfb2f to
52fd3e0
Compare
YoannAbriel
force-pushed
the
fix/issue-62218
branch
from
March 9, 2026 22:03
52fd3e0 to
73606bc
Compare
potiuk
approved these changes
Mar 10, 2026
dominikhei
pushed a commit
to dominikhei/airflow
that referenced
this pull request
Mar 11, 2026
…ing Celery tasks (apache#62869) * fix: warn about hardcoded 24h visibility_timeout that kills long-running Celery tasks Add a warning log when the default visibility_timeout of 86400 seconds (24 hours) is applied for Redis/SQS brokers, so users with long-running tasks know to increase it. Fix misleading task_acks_late documentation that incorrectly claimed it overrides visibility_timeout (it does not for Redis/SQS brokers). Fixes apache#62218 * fix: fix test assertion for visibility_timeout type (int vs string) * fix: apply ruff format to test file * fix: update get_provider_info.py to match provider.yaml description * ci: retrigger CI (unrelated infra failures)
Pyasma
pushed a commit
to Pyasma/airflow
that referenced
this pull request
Mar 13, 2026
…ing Celery tasks (apache#62869) * fix: warn about hardcoded 24h visibility_timeout that kills long-running Celery tasks Add a warning log when the default visibility_timeout of 86400 seconds (24 hours) is applied for Redis/SQS brokers, so users with long-running tasks know to increase it. Fix misleading task_acks_late documentation that incorrectly claimed it overrides visibility_timeout (it does not for Redis/SQS brokers). Fixes apache#62218 * fix: fix test assertion for visibility_timeout type (int vs string) * fix: apply ruff format to test file * fix: update get_provider_info.py to match provider.yaml description * ci: retrigger CI (unrelated infra failures)
edsu
added a commit
to sul-dlss/rialto-airflow
that referenced
this pull request
Apr 17, 2026
JWT_EXPIRATION_TIME didn't seem to help: our long running harvest_dimensions task failed at 24 hours. This PR seems to indicate that the problem might be a default in Celery instead, so I'm giving that a try next. apache/airflow#62869 The docs are at: https://airflow.apache.org/docs/apache-airflow-providers-celery/stable/configurations-ref.html#visibility-timeout
edsu
added a commit
to sul-dlss/rialto-airflow
that referenced
this pull request
Apr 17, 2026
JWT_EXPIRATION_TIME didn't seem to help: our long running harvest_dimensions task failed at 24 hours. This PR seems to indicate that the problem might be a default in Celery instead, so I'm giving that a try next. apache/airflow#62869 The docs are at: https://airflow.apache.org/docs/apache-airflow-providers-celery/stable/configurations-ref.html#visibility-timeout
edsu
added a commit
to sul-dlss/rialto-airflow
that referenced
this pull request
Apr 17, 2026
JWT_EXPIRATION_TIME didn't seem to help: our long running harvest_dimensions task failed at 24 hours. This PR seems to indicate that the problem might be a default in Celery instead, so I'm giving that a try next. apache/airflow#62869 The docs are at: https://airflow.apache.org/docs/apache-airflow-providers-celery/stable/configurations-ref.html#visibility-timeout
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: warn about hardcoded 24h visibility_timeout that kills long-running Celery tasks
Problem
When using the Celery executor with Redis/SQS brokers and no explicit
visibility_timeoutconfigured, Airflow silently applies a default of 86400 seconds (24 hours) indefault_celery.py. Tasks running longer than 24 hours are terminated by the broker redelivering the message to another worker, which fails withServerResponseError('Invalid auth token: Signature has expired'). Users have no indication this limit exists or how to change it.The
task_acks_lateconfiguration description also incorrectly states it "effectively overrides the visibility timeout", which is not true for Redis/SQS brokers — the broker-level redelivery happens regardless of acknowledgment settings.Root Cause
get_default_celery_config()indefault_celery.pyhardcodesbroker_transport_options["visibility_timeout"] = 86400when no value is configured and the broker is Redis or SQS. This happens silently with no log output, so users don't know about the 24h limit until their tasks are killed. Thetask_acks_latedocumentation inget_provider_info.pycompounds the confusion by claiming it overrides visibility_timeout.Fix
Three changes in the celery provider:
default_celery.py: Added alog.warning()when the default 86400s visibility_timeout is applied, telling users about the limit and how to increase it via[celery_broker_transport_options] visibility_timeout.get_provider_info.py(task_acks_latedescription): Corrected the documentation to state thattask_acks_latedoes NOT overridevisibility_timeoutfor Redis/SQS brokers, and that users must separately increasevisibility_timeoutfor long-running tasks.get_provider_info.py(visibility_timeoutdescription): Added note that Airflow defaults to 86400s when not configured, and that tasks exceeding this value will be terminated.Added 3 unit tests:
test_visibility_timeout_default_warns_when_not_configured— verifies warning is logged with Redis brokertest_visibility_timeout_no_warning_when_configured— verifies no warning when explicitly settest_visibility_timeout_not_set_for_unsupported_broker— verifies no warning/default for RabbitMQTests follow existing patterns in
test_celery_executor.py(validated via CI).Closes: #62218
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code following the guidelines
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.