Skip to content

Task acks on Hard Timeout when task_acks_on_failure_or_timeout is False #9596

Closed

Description

@JacksonKontny

Checklist

  • I have verified that the issue exists against the main branch of Celery.
  • This has already been asked to the discussions forum first.
  • I have read the relevant section in the
    contribution guide
    on reporting bugs.
  • I have checked the issues list
    for similar or identical bug reports.
  • I have checked the pull requests list
    for existing proposed fixes.
  • I have checked the commit log
    to find out if the bug was already fixed in the main branch.
  • I have included all related issues and possible duplicate issues
    in this issue (If there are none, check this box anyway).
  • I have tried to reproduce the issue with pytest-celery and added the reproduction script below.

Mandatory Debugging Information

  • I have included the output of celery -A proj report in the issue.
    (if you are not able to do this, then at least specify the Celery
    version affected).
  • I have verified that the issue exists against the main branch of Celery.
  • I have included the contents of pip freeze in the issue.
  • I have included all the versions of all the external dependencies required
    to reproduce this bug.

Optional Debugging Information

  • I have tried reproducing the issue on more than one Python version
    and/or implementation.
  • I have tried reproducing the issue on more than one message broker and/or
    result backend.
  • I have tried reproducing the issue on more than one version of the message
    broker and/or result backend.
  • I have tried reproducing the issue on more than one operating system.
  • I have tried reproducing the issue on more than one workers pool.
  • I have tried reproducing the issue with autoscaling, retries,
    ETA/Countdown & rate limits disabled.
  • I have tried reproducing the issue after downgrading
    and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

Possible Duplicates

  • None

Environment & Settings

5.4.0 (opalescent):

Output:
software -> celery:5.4.0 (opalescent) kombu:5.4.2 py:3.11.9
            billiard:4.2.1 py-amqp:5.3.1
platform -> system:Linux arch:64bit, ELF
            kernel version:6.10.14-linuxkit imp:CPython
loader   -> celery.loaders.app.AppLoader
settings -> transport:amqp results:disabled

deprecated_settings: None
worker_disable_rate_limits: True
event_queue_expires: 30
event_queue_ttl: 5
worker_hijack_root_logger: False
worker_send_task_events: False
task_acks_late: True
task_acks_on_failure_or_timeout: False
task_ignore_result: True
task_reject_on_worker_lost: True
worker_cancel_long_running_tasks_on_connection_loss: True
broker_heartbeat: 120
task_queues: [<unbound Queue a -> <unbound Exchange tasks(direct)> -> tasks>,
 <unbound Queue b -> <unbound Exchange tasks(direct)> -> tasks>,
 <unbound Queue c -> <unbound Exchange tasks(direct)> -> tasks>,
 <unbound Queue d -> <unbound Exchange tasks(direct)> -> tasks>]</b></summary>
<p>

Steps to Reproduce

Required Dependencies

  • Minimal Python Version: N/A or Unknown
  • Minimal Celery Version: N/A or Unknown
  • Minimal Kombu Version: N/A or Unknown
  • Minimal Broker Version: N/A or Unknown
  • Minimal Result Backend Version: N/A or Unknown
  • Minimal OS and/or Kernel Version: N/A or Unknown
  • Minimal Broker Client Version: N/A or Unknown
  • Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output: amqp==5.3.1 attrs==25.1.0 bcrypt==4.2.1 billiard==4.2.1 blinker==1.9.0 Brotli==1.1.0 bytecode==0.16.1 cachetools==5.5.2 cattrs==24.1.2 celery==5.4.0 certifi==2025.1.31 cffi==1.17.1 charset-normalizer==3.4.1 cryptography==43.0.3 cssselect2==0.7.0 Deprecated==1.2.18 dnspython==2.6.1 envier==0.6.1 filelock==3.12.4 Flask==3.0.3 Flask-Minify==0.49 flask-talisman==1.1.0 Flask-WTF==1.2.2 fonttools==4.56.0 greenlet==3.1.1 grpc-google-iam-v1==0.14.1 grpcio==1.70.0 grpcio-status==1.70.0 gunicorn==23.0.0 html5lib==1.1 htmlminf==0.1.13 idna==3.10 importlib_metadata==8.5.0 itsdangerous==2.2.0 Jinja2==3.1.5 jsmin==3.0.1 kombu==5.4.2 lesscpy==0.15.1 MarkupSafe==3.0.2 msal==1.27.0 opentelemetry-api==1.30.0 packaging==24.2 peewee==3.17.9 phonenumbers==8.10.23 pika==1.3.2 pillow==10.3.0 ply==3.11 progress==1.6 prompt_toolkit==3.0.50 proto-plus==1.26.0 protobuf==5.29.3 pyasn1==0.6.1 pyasn1_modules==0.4.1 pycparser==2.22 pydicom==3.0.1 pydyf==0.11.0 PyJWT==2.10.1 PyMySQL==1.1.1 pynetdicom==2.0.2 pyotp==2.9.0 pyphen==0.17.2 python-crontab==2.3.9 python-dateutil==2.8.2 python-json-logger==2.0.7 pytz==2023.4 pyvips==2.1.16 PyYAML==6.0.2 rcssmin==1.2.1 regex==2023.6.3 requests==2.32.3 retrying==1.3.4 rsa==4.9 setproctitle==1.3.5 six==1.17.0 slack-sdk==3.21.3 slimit==0.8.1 SQLAlchemy==2.0.38 sqlparse==0.5.3 statsd==3.2.2 supervisor==4.2.5 tabulate==0.9.0 tinycss2==1.4.0 toml==0.10.2 tornado==6.4.2 typing_extensions==4.12.2 tzdata==2025.1 urllib3==1.26.20 vine==5.1.0 watchdog==6.0.0 wcwidth==0.2.13 weasyprint==62.3 webencodings==0.5.1 Werkzeug==3.0.6 wrapt==1.17.2 WTForms==3.2.1 xmltodict==0.13.0 xxhash==3.5.0 yoyo-migrations==8.0.0 zipp==3.21.0 zopfli==0.2.3.post1

Other Dependencies

Details

N/A

Minimally Reproducible Test Case

Details

Expected Behavior

When the hard time limit is surpassed during execution, the task should be requeued if task_acks_late: True
and task_acks_on_failure_or_timeout: False

Actual Behavior

When the hard time limit is surpassed during execution with task_acks_late: True
and task_acks_on_failure_or_timeout: False , on_reject is called with requeue=False here

Activity

  1. Nusnus commented on Mar 16, 2025

    @Nusnus
    Member

    Thank you for the report.
    I see you already have some progress here: #9597

    Would you like to contribute a fix in a PR? I’d be happy to review it.
    Just make sure to add the necessary tests.

    Thank you!

  2. JacksonKontny commented on Mar 17, 2025

    @JacksonKontny
    ContributorAuthor

    Would you like to contribute a fix in a PR? I’d be happy to review it. Just make sure to add the necessary tests.

    @Nusnus happily, thanks for your reply. Will do.

  3. JacksonKontny commented on Mar 18, 2025

    @JacksonKontny
    ContributorAuthor

    @Nusnus The PR with tests is linked ^

  4. added this to the 5.5.0 milestone on Mar 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions