Skip to content

Race condition Airflow's Celery executor timeout and import redis leave a broken import #41359

Description

@quangvnm

Apache Airflow version

2.9.3

If "Other Airflow 2 version" selected, which one?

No response

What happened?

Hello,

This is a copy-paste of an issue we also post on celery/kombu and redis/redis-py. We include a MCVE example at the end of this post.

TL;DR: The with timeout(seconds=OPERATION_TIMEOUT): in airflow.executors.celery_executor.send_task_to_executor might leave a very broken import of redis & may affect another package that we haven't discovered yet. This is a race condition and very hard to debug at first. To reproduce this bug, we have to

  • have a celery timeout (we kept it at default 1.0 second)
  • the timeout should happen during an import
  • a long import (we aren't sure the import of redis is long and this bug happens mostly with redis package, maybe this is a confirmation bias)

Relates:

Our environment:

airflow: this happens with both 2.6 and latest 2.9.3 version
helm chart: 1.9, 1.14 or 1.15
python: 3.11.9
redis: 4.6.0 (airflow 2.6) and 5.0.7 (airflow 2.9)
kombu: 5.3.1 (airflow 2.6) and 5.3.7 (airflow 2.9)

We 've observed this issue since at least several months ago with our airflow deployment using official helm chart, we have the same issue as in related issues/discussion:

Aug 8 08:29:02 airflow-XXX-scheduler-XXX-zhtb8 scheduler ERROR {timeout.py:68} ERROR - Process timed out, PID: 7
Aug 8 08:29:02 airflow-XXX-scheduler-XXX-zhtb8 scheduler {celery_executor.py:279} INFO - [Try 1 of 3] Task Timeout Error for Task: (TaskInstanceKey(dag_id='XXX', task_id='XXX', run_id='manual__2024-06-19T14:06:39+00:00', try_number=51, map_index=-1)).
Aug 8 08:29:03 airflow-XXX-scheduler-XXX-zhtb8 scheduler {celery_executor.py:290} ERROR - Error sending Celery task: module 'redis' has no attribute 'client'
Aug 8 08:29:03 airflow-XXX-scheduler-XXX-zhtb8 scheduler Celery Task ID: TaskInstanceKey(dag_id='XXX', task_id='XXX', run_id='manual__2024-06-19T14:06:39+00:00', try_number=51, map_index=-1)
Aug 8 08:29:03 airflow-XXX-scheduler-XXX-zhtb8 scheduler Traceback (most recent call last):
  File "/home/airflow/.local/lib/python3.11/site-packages/airflow/providers/celery/executors/celery_executor_utils.py", line 220, in send_task_to_executor
    result = task_to_run.apply_async(args=[command], queue=queue)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/task.py", line 594, in apply_async
    return app.send_task(
           ^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/base.py", line 797, in send_task
    with self.producer_or_acquire(producer) as P:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/base.py", line 932, in producer_or_acquire
    producer, self.producer_pool.acquire, block=True,
              ^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/base.py", line 1354, in producer_pool
    return self.amqp.producer_pool
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/amqp.py", line 591, in producer_pool
    self.app.connection_for_write()]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/base.py", line 829, in connection_for_write
    return self._connection(url or self.conf.broker_write_url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/celery/app/base.py", line 880, in _connection
    return self.amqp.Connection(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/kombu/connection.py", line 201, in __init__
    if not get_transport_cls(transport).can_parse_url:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/kombu/transport/__init__.py", line 90, in get_transport_cls
    _transport_cache[transport] = resolve_transport(transport)
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/kombu/transport/__init__.py", line 75, in resolve_transport
    return symbol_by_name(transport)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/airflow/.local/lib/python3.11/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name
    module = imp(module_name, package=package, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._XXX>", line 1204, in _gcd_import
  File "<frozen importlib._XXX>", line 1176, in _find_and_load
  File "<frozen importlib._XXX>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._XXX>", line 690, in _load_unlocked
  File "<frozen importlib._XXX_external>", line 940, in exec_module
  File "<frozen importlib._XXX>", line 241, in _call_with_frames_removed
  File "/home/airflow/.local/lib/python3.11/site-packages/kombu/transport/redis.py", line 285, in <module>
    class PrefixedRedisPipeline(GlobalKeyPrefixMixin, redis.client.Pipeline):
                                                      ^^^^^^^^^^^^
Aug 8 08:29:03 airflow-XXX-scheduler-XXX-zhtb8 scheduler AttributeError: module 'redis' has no attribute 'client'

We've verified and we have neither redis folder nor redis.py file from our dev, this is a very sporadic error where most of the time it works, then it stops working for unknown reason, and once if happens, the scheduler is broken and couldn't schedule anything (same error message) until we restart the scheduler process (restart the pod)

This happens quite randomly (one in tens or fifty deployments of helm chart), and we couldn't reproduce it for sure for debugging purpose.

What we found out is that if this happens, this bug won't disappear until we restart (kill) the scheduler pod.
We could reproduce randomly with these steps in a test airflow:

  • kubectl delete po -l release=airflow-XXX,component=scheduler --force --grace-period 0
  • Clear a DAG task and hope that the bug happens, this should be immediate, if not, repeat the whole process

At first, we suspect that this is a case of race condition in importing redis package, because we inject debug code before the line class PrefixedRedisPipeline(GlobalKeyPrefixMixin, redis.client.Pipeline): with print(sys.path), print(redis), print(redis.__version__), ... and everything is okay, except print(dir(redis)) gives a different result:

sys.path=['/home/airflow/.local/bin', '/usr/local/lib/python311.zip', '/usr/local/lib/python3.11', '/usr/local/lib/python3.11/lib-dynload', '/home/airflow/.local/lib/python3.11/site-packages', '/opt/airflow/dags/repo/', '/opt/airflow/config', '/opt/airflow/plugins']

redis=<module 'redis' from '/home/airflow/.local/lib/python3.11/site-packages/redis/__init__.py'>

redis.__version__=5.0.7

dir(redis)=['AuthenticationError', 'AuthenticationWrongNumberOfArgsError', 'BlockingConnectionPool', 'BusyLoadingError', 'ChildDeadlockedError', 'Connection', 'ConnectionError', 'ConnectionPool', 'CredentialProvider', 'DataError', 'InvalidResponse', 'OutOfMemoryError', 'PubSubError', 'ReadOnlyError', 'Redis', 'RedisCluster', 'RedisError', 'ResponseError', 'SSLConnection', 'Sentinel', 'SentinelConnectionPool', 'SentinelManagedConnection', 'SentinelManagedSSLConnection', 'StrictRedis', 'TimeoutError', 'UnixDomainSocketConnection', 'UsernamePasswordCredentialProvider', 'VERSION', 'WatchError', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', 'asyncio', 'cluster', 'default_backoff', 'from_url', 'int_or_str', 'metadata', 'sentinel', 'sys']

compared to a python shell session inside the same container:

Python 3.11.9 (main, Jul 23 2024, 07:22:56) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> redis
<module 'redis' from '/home/airflow/.local/lib/python3.11/site-packages/redis/__init__.py'>
>>> redis.__version__
'5.0.7'
>>> dir(redis)
['AuthenticationError', 'AuthenticationWrongNumberOfArgsError', 'BlockingConnectionPool', 'BusyLoadingError', 'ChildDeadlockedError', 'Connection', 'ConnectionError', 'ConnectionPool', 'CredentialProvider', 'DataError', 'InvalidResponse', 'OutOfMemoryError', 'PubSubError', 'ReadOnlyError', 'Redis', 'RedisCluster', 'RedisError', 'ResponseError', 'SSLConnection', 'Sentinel', 'SentinelConnectionPool', 'SentinelManagedConnection', 'SentinelManagedSSLConnection', 'StrictRedis', 'TimeoutError', 'UnixDomainSocketConnection', 'UsernamePasswordCredentialProvider', 'VERSION', 'WatchError', '__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '__version__', '_parsers', 'asyncio', 'backoff', 'client', 'cluster', 'commands', 'compat', 'connection', 'crc', 'credentials', 'default_backoff', 'exceptions', 'from_url', 'int_or_str', 'lock', 'metadata', 'retry', 'sentinel', 'sys', 'typing', 'utils']

We noted that dir(redis) inside the troublesome scheduler lacks several attributes, notably redis.client

Another thing we discovered is that in every case, there is always a Timeout (as you could see the log above), and sure enough, we found out later that the bug always happens while the process of importing redis is interrupted by Timeout (we print line number in redis/__init__.py and the importing didn't run till the end). In very rare case, airflow.utils.timeout doesn't work as inteded, the timeout error is printed out in the middle of import redis but the import redis still run till the end, in this case, the bug couldn't happens. But most of the time, the timeout interrupt the import.

With this idea, we injected a sleep at the end of redis/__init__.py and sure enough, we could reproduce this bug every time.

So an interrupted import give a different import than a normal import, it seems that the broken import doesn't import not-public member in package, such as redis.client in this case, Redis, StrictRedis are exposed explicitly but redis.client is set "impliciteley"

# redis/__init__.py
from redis.client import Redis, StrictRedis

I've found one comment from discuss.python.org:

import asyncio
original = id(asyncio)
from asyncio.base_events import BaseEventLoop
assert id(asyncio) == original
assert asyncio.base_events.BaseEventLoop is BaseEventLoop

From which it should be clear that asyncio.base_events is indeed guaranteed to be set after the from-import.

-- discuss.python.org

In our case, if we try to reimport an interrupted import, this isn't true anymore, the submodule isn't set at all. We didn't dig further in internal python to find out why this happens.

We see at least four options to fix this bug:

  • Increase celery's operation_timeout (by config or env var). This isn't error-proof but at least reduce drastically the number of this bug
  • inject from redis import client to redis/__init__.py
  • patch kombu/transport/redis.py with
    from redis import client
    and replace every redis.client by client

We opt for the second method in our dev at the moment

We aren't sure that this bug happens enough to be taken into consideration in upstream? But at least other dev won't loose days of debugging session as us ^^

This raise another question: Could the Timeout or another mechanism break the import and introduce this bug in another package or another hard-to-catch race condition bug?

What you think should happen instead?

The airflow timeout should not leave a broken import. We are not sure if this should be addressed to redis/redis-py though, we post the same issue in celery/kombu and redis/redis-py.

How to reproduce

This is a race condition which is hard to duplicate in local machine, so what we did is to introduce a delay to the very first import of redis to reproduce this bug for sure.

Please find below a compressed file of three file:

  • mock_kombu_transport_redis.py
  • mock_airflow.py
  • and redis.patch/init.py, we need to add the content of this file at the end of redis-py package's __init__.py to add the delay in import
    mcve.zip

python -m mock_airflow gives the result:

FunctionTimedOut

After failed import redis
'redis' in sys.modules: True
'redis.client' in sys.modules: True

Reimport mock_kombu_transport_redis
After reimport redis
'redis' in sys.modules: True
'redis.client' in sys.modules: True
'client' in dir(redis): False
getattr(redis, 'client', None)=None

After reimport redis.client
'client' in dir(redis): False
getattr(redis, 'client', None)=None

After reimport: from redis import client
client=<module 'redis.client' from '***/site-packages/redis/client.py'>
'client' in dir(redis): False
getattr(redis, 'client', None)=None
client.Pipeline=<class 'redis.client.Pipeline'>

The important line is 'client' in dir(redis): False event after a reimport of failed import and if we uncomment the line of print(redis.client), it will raise an error:

AttributeError: module 'redis' has no attribute 'client'

If we inject from redis import client to redis/__init__.py, the mcve gives the diffent output:

...
After reimport redis
'redis' in sys.modules: True
'redis.client' in sys.modules: True
'client' in dir(redis): True
getattr(redis, 'client', None)=<module 'redis.client' from 'XXX/site-packages/redis/client.py'>
...

(Changes: client' in dir(redis): True and getattr(redis, 'client', None)=)

Operating System

Debian GNU/Linux 12 (bookworm)

Versions of Apache Airflow Providers

apache-airflow-providers-celery==3.7.2
apache-airflow-providers-redis==3.7.1

Deployment

Official Apache Airflow Helm Chart

Deployment details

Helm: 3.11.3
Helm chart: apache/airflow:1.15.0
k8s: 1.28

Anything else?

A race condition which happen very rarely at the start of scheduler service, but as we deploy to dev/staging alot each day, this happens several time a day. Once it happens, it won't go away until restart of this scheduler service. Condition:

  • have a celery timeout (we kept it at default 1.0 second)
  • the timeout should happen during an import
  • a long import (we aren't sure the import of redis is long and this bug happens mostly with redis package, maybe this is a confirmation bias)

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. added
    kind:bug
    needs-triage
    on Aug 9, 2024
  2. boring-cyborg commented on Aug 9, 2024

    @boring-cyborg

    Thanks for opening your first issue here! Be sure to follow the issue template! If you are willing to raise PR to address this issue please do so, no need to wait for approval.

  3. changed the title [-]Race condition Ariflow's Celery executor timeout and import redis[/-] [+]Race condition Ariflow's Celery executor timeout and import redis leave a broken import[/+] on Aug 9, 2024
  4. changed the title [-]Race condition Ariflow's Celery executor timeout and import redis leave a broken import[/-] [+]Race condition Airflow's Celery executor timeout and import redis leave a broken import[/+] on Aug 9, 2024
  5. quangvnm commented on Aug 9, 2024

    @quangvnm
    Author

    Crossed-post:
    redis/redis-py#3353
    celery/kombu#2096

    And a very helpful response from discuss.python.org

  6. DartVeDroid commented on Sep 6, 2024

    @DartVeDroid

    Happens to us for some time, too. The same AttributeError, the same inability to work until you restart the pod.

    That's quite a coincidence: there was an another bug in kombu itself that affected redis deployments (celery/kombu#2007). IIRC, it affected a couple Airflow versions rendering them unstable.

    Now, IMO, the usability problem is the same in both cases: container doesn't even crash, thus k8s can't auto-solve it by restarting the pod.

  7. alimoezzi commented on Sep 17, 2024

    @alimoezzi

    I also have experience this in k8s deployment. Would only be fix by manual intervention.

  8. added and removed
    needs-triage
    on Sep 27, 2024
  9. eladkal commented on Nov 7, 2024

    @eladkal
    Contributor

    According to celery/kombu#2007 (comment)
    The issue is fixed in Celery v5.5.0b1 so we might want to bump min version for Celery to avoid this issue for everyone.

    Can anyone confirm if upgrading to Celery 5.5.0 solves the problem? (Celery 5.5.0 not released yet, but rc1 is averrable so if anyone can confirm this solves the issue by checking it in test enviroment that would be great)

  10. 2 remaining items

  11. Vprok commented on Jul 23, 2025

    @Vprok

    Thanks for this issue and replies!
    Problem still exists on apache/airflow:2.11.0-python3.12 with k8s.
    Package versions:

    apache-airflow==2.11.0  
    apache-airflow-providers-celery==3.11.0  
    apache-airflow-providers-redis==4.1.0  
    celery==5.5.2  
    kombu==5.5.3  
    redis==5.2.1  
    

    The scheduler intermittently freezes after deploy and logs errors when starting DAGs:

    Executor CeleryKubernetesExecutor(parallelism=32) reported that the task instance <TaskInstance: ...
    

    Previous tried:

    • Upgraded python3.11 -> python3.12
    • Upgraded from Airflow 2.10.5 → 2.11.0
    • Upgraded related providers (airflow-provider-celery, airflow-provider-redis)

    Issue temporarily resolved but reappeared after ~2 weeks.

  12. DartVeDroid commented on Jul 24, 2025

    @DartVeDroid

    Thanks for this issue and replies! Problem still exists on apache/airflow:2.11.0-python3.12 with k8s. Package versions:
    Issue temporarily resolved but reappeared after ~2 weeks.

    Hello fellow Airflow user

    I would suggest (apart from increasing the timeout value) upgrading to Airflow 3.
    It may be tedious, but in v3 old scheduler got split into two different containers: scheduler and dag processor, which in our case should reduce the load on scheduler and, therefore, minimize the chance of this problem occurring.

  13. avolant commented on Sep 29, 2025

    @avolant
    Contributor

    Hello 👋

    I would suggest (apart from increasing the timeout value) upgrading to Airflow 3.

    We are still experiencing the issue with Airflow 3.0.6 :)

  14. srozov commented on Oct 8, 2025

    @srozov

    @potiuk please reopen this issue. The problem is not solved.

  15. potiuk commented on Oct 13, 2025

    @potiuk
    Member

    @potiuk please reopen this issue. The problem is not solved.

    Sure, I can reopen, however some more diagnosis from those experiencing it and evidences will likely be needed for anyone to diagnose and fix it. If anyone (@srozov ? ) can provide more evidences, that will increase probability it will be diagnosed and solved.

  16. reopened this on Oct 13, 2025
  17. EssKayz commented on Nov 4, 2025

    @EssKayz

    Experiencing the same on 3.0.6 and 3.1.0, and in addition to the same kind of logs as above referring to imports of redis.client failing due to attribute client not existing in module redis - we also get the following type of error, which seems to coincide with kombu as referred in celery/kombu#2096
    For now we've circumvented the errors by restarting the tasks, and/or restarting the scheduler container itself
    ->

    Traceback (most recent call last):
    2025-11-04T09:23:49.017062720Z   File "/home/airflow/.local/lib/python3.13/site-packages/airflow/providers/celery/executors/celery_executor_utils.py", line 285, in send_task_to_executor
    2025-11-04T09:23:49.017077209Z     result = task_to_run.apply_async(args=args, queue=queue)
    2025-11-04T09:23:49.017083616Z   File "/home/airflow/.local/lib/python3.13/site-packages/celery/app/task.py", line 601, in apply_async
    2025-11-04T09:23:49.017090179Z     return app.send_task(
    2025-11-04T09:23:49.017095688Z            ~~~~~~~~~~~~~^
    2025-11-04T09:23:49.017101293Z         self.name, args, kwargs, task_id=task_id, producer=producer,
    2025-11-04T09:23:49.017106442Z         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2025-11-04T09:23:49.017111400Z     ...<2 lines>...
    2025-11-04T09:23:49.017117835Z         **options
    2025-11-04T09:23:49.017123467Z         ^^^^^^^^^
    2025-11-04T09:23:49.017130394Z     )
    2025-11-04T09:23:49.017135817Z     ^
    2025-11-04T09:23:49.017140267Z   File "/home/airflow/.local/lib/python3.13/site-packages/celery/app/base.py", line 835, in send_task
    2025-11-04T09:23:49.017146556Z     driver_type = self.producer_pool.connections.connection.transport.driver_type
    2025-11-04T09:23:49.017352698Z                   ^^^^^^^^^^^^^^^^^^
    2025-11-04T09:23:49.017360239Z   File "/home/airflow/.local/lib/python3.13/site-packages/celery/app/base.py", line 1486, in producer_pool
    2025-11-04T09:23:49.017366293Z     return self.amqp.producer_pool
    2025-11-04T09:23:49.017371828Z            ^^^^^^^^^^^^^^^^^^^^^^^
    2025-11-04T09:23:49.017377328Z   File "/home/airflow/.local/lib/python3.13/site-packages/celery/app/amqp.py", line 597, in producer_pool
    2025-11-04T09:23:49.017382945Z     self.app.connection_for_write()]
    2025-11-04T09:23:49.017388518Z     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
    2025-11-04T09:23:49.017393225Z   File "/home/airflow/.local/lib/python3.13/site-packages/celery/app/base.py", line 958, in connection_for_write
    2025-11-04T09:23:49.017398510Z     return self._connection(url or self.conf.broker_write_url, **kwargs)
    2025-11-04T09:23:49.017404724Z            ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2025-11-04T09:23:49.017409435Z   File "/home/airflow/.local/lib/python3.13/site-packages/celery/app/base.py", line 1009, in _connection
    2025-11-04T09:23:49.017422022Z     return self.amqp.Connection(
    2025-11-04T09:23:49.017428061Z            ~~~~~~~~~~~~~~~~~~~~^
    2025-11-04T09:23:49.017434370Z         url,
    2025-11-04T09:23:49.017440280Z         ^^^^
    2025-11-04T09:23:49.017445384Z     ...<16 lines>...
    2025-11-04T09:23:49.017451074Z         ),
    2025-11-04T09:23:49.017456489Z         ^^
    2025-11-04T09:23:49.017461154Z     )
    2025-11-04T09:23:49.017467444Z     ^
    2025-11-04T09:23:49.017472361Z   File "/home/airflow/.local/lib/python3.13/site-packages/kombu/connection.py", line 201, in __init__
    2025-11-04T09:23:49.017490366Z     if not get_transport_cls(transport).can_parse_url:
    2025-11-04T09:23:49.017496762Z            ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
    2025-11-04T09:23:49.017501868Z   File "/home/airflow/.local/lib/python3.13/site-packages/kombu/transport/__init__.py", line 92, in get_transport_cls
    2025-11-04T09:23:49.017508112Z     _transport_cache[transport] = resolve_transport(transport)
    2025-11-04T09:23:49.017514392Z                                   ~~~~~~~~~~~~~~~~~^^^^^^^^^^^
    2025-11-04T09:23:49.017521735Z   File "/home/airflow/.local/lib/python3.13/site-packages/kombu/transport/__init__.py", line 77, in resolve_transport
    2025-11-04T09:23:49.017529432Z     return symbol_by_name(transport)
    2025-11-04T09:23:49.017535059Z   File "/home/airflow/.local/lib/python3.13/site-packages/kombu/utils/imports.py", line 59, in symbol_by_name
    2025-11-04T09:23:49.017541389Z     module = imp(module_name, package=package, **kwargs)
    2025-11-04T09:23:49.017548595Z   File "/usr/python/lib/python3.13/importlib/__init__.py", line 88, in import_module
    2025-11-04T09:23:49.017555270Z     return _bootstrap._gcd_import(name[level:], package, level)
    2025-11-04T09:23:49.017560788Z            ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    2025-11-04T09:23:49.017566260Z   File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
    2025-11-04T09:23:49.017572402Z   File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
    2025-11-04T09:23:49.017578308Z   File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
    2025-11-04T09:23:49.017584170Z   File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
    2025-11-04T09:23:49.017589625Z   File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
    2025-11-04T09:23:49.017595561Z   File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
    2025-11-04T09:23:49.017602214Z   File "/home/airflow/.local/lib/python3.13/site-packages/kombu/transport/redis.py", line 83, in <module>
    2025-11-04T09:23:49.017608422Z     import redis
    2025-11-04T09:23:49.017613630Z   File "/home/airflow/.local/lib/python3.13/site-packages/redis/__init__.py", line 3, in <module>
    2025-11-04T09:23:49.017620365Z     from redis import asyncio  # noqa
    2025-11-04T09:23:49.017626303Z     ^^^^^^^^^^^^^^^^^^^^^^^^^
    2025-11-04T09:23:49.017631071Z   File "/home/airflow/.local/lib/python3.13/site-packages/redis/asyncio/__init__.py", line 1, in <module>
    2025-11-04T09:23:49.017637777Z     from redis.asyncio.client import Redis, StrictRedis
    2025-11-04T09:23:49.017643847Z   File "/home/airflow/.local/lib/python3.13/site-packages/redis/asyncio/client.py", line 43, in <module>
    2025-11-04T09:23:49.017650325Z     from redis.client import (
    2025-11-04T09:23:49.017655501Z     ...<4 lines>...
    2025-11-04T09:23:49.017668250Z     )
    2025-11-04T09:23:49.017673320Z   File "/home/airflow/.local/lib/python3.13/site-packages/redis/client.py", line 17, in <module>
    2025-11-04T09:23:49.017680386Z     from redis.commands import (
    2025-11-04T09:23:49.017686879Z     ...<4 lines>...
    2025-11-04T09:23:49.017692458Z     )
    2025-11-04T09:23:49.017697561Z   File "/home/airflow/.local/lib/python3.13/site-packages/redis/commands/__init__.py", line 1, in <module>
    2025-11-04T09:23:49.017703425Z     from .cluster import READ_COMMANDS, AsyncRedisClusterCommands, RedisClusterCommands
    2025-11-04T09:23:49.017709407Z   File "/home/airflow/.local/lib/python3.13/site-packages/redis/commands/cluster.py", line 29, in <module>
    2025-11-04T09:23:49.017715663Z     from .core import (
    2025-11-04T09:23:49.017720976Z     ...<15 lines>...
    2025-11-04T09:23:49.017726774Z     )
    2025-11-04T09:23:49.017738602Z   File "/home/airflow/.local/lib/python3.13/site-packages/airflow/sdk/execution_time/timeout.py", line 38, in handle_timeout
    2025-11-04T09:23:49.017745729Z     raise AirflowTaskTimeout(self.error_message)
    2025-11-04T09:23:49.017751654Z airflow.exceptions.AirflowTaskTimeout: Timeout, PID: 153```
    
  18. DartVeDroid commented on Nov 5, 2025

    @DartVeDroid

    For now we've circumvented the errors by restarting the tasks, and/or restarting the scheduler container itself

    Do you need to check for the error manually, though? If true, that could be costly in the long run, both in employees' time and delivery delays.

    UPD1-3:
    A sort of compromise could be found if all your DAGs' schedules' steps are large enough, by setting the container to restart once in a while in k8s, e. g. by setting liveness probes to always fail with a timeout time of 6h or something like that.

    UPD4-7:
    A guy in combu celery/kombu#2096 (comment) says it was a problem in redis-py.
    Yet redis-py just closed it after auto-marking it as stale redis/redis-py#3353 (comment), despite having been provided with a fix.

  19. wangzc93 commented on Dec 7, 2025

    @wangzc93

    In case you don't have a large number of concurrent tasks like us, we switched to LocalExecutor to avoid this issue.

  20. q-ventsislav commented on Dec 16, 2025

    @q-ventsislav

    We also experienced this multiple times at random intervals on:
    Version: v2.11.0
    Git Version: .release:d9ed7b94d033dc61ee1c05aafb9f1c1f7b82cfb2

  21. added a commit that references this issue on Feb 10, 2026
    cd094d7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions