You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minimal Result Backend Client Version: N/A or Unknown
Python Packages
pip freeze Output:
Other Dependencies
N/A
Minimally Reproducible Test Case
Expected Behavior
After a task is redelivered to new worker post visibility timeout, the task should be removed from previous worker's reserved list.
If a task is expired, it should not be executed by the worker.
Actual Behavior
A task is received by a worker but not executed. It then gets redelivered to a new worker after visibility timeout (3600). The new worker executes the task. And then, after 2-3 days, original worker also executed the task. (even though task has an expiration of 6 hours)
Logs:
worker32.log:[2022-11-14 14:53:33,063: INFO/MainProcess] Received task: task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] expires:[2022-11-14 20:53:32.659098+00:00]
[2022-11-18 00:02:33,906: INFO/ForkPoolWorker-732] Task task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] succeeded in 0.42657385021448135s:
worker33.log:[2022-11-14 15:53:36,000: INFO/MainProcess] Received task: task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] expires:[2022-11-14 20:53:32.659098+00:00]
[2022-11-14 15:53:37,000: INFO/ForkPoolWorker-64] Task task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] succeeded in 0.2886648119892925s:
I checked another case currently going on - worker A has reserved a task, it got redelivered to new worker B after 1 hour (visibility timeout). Worker B executed the task. But the task is still reserved with the worker A for more than 2 days and not getting executed.
workerA: [2022-11-18 08:44:06,400: INFO/MainProcess] Received task: api.pkg.get_ticket_info[d7f42e6e-xxxx-471b-ba7d-14a6d666exxx] expires:[2022-11-18 14:44:06.140396+00:00]
user:/var/log/celery$ date
Sun Nov 20 17:36:23 UTC 2022
@auvipy Can you suggest if moving to latest version would fix the issue. Moving to latest version will require lot of changes from our end and would like to know if these bugs are fixed in latest version.
Because similar issue is posted hre with version 5.2.7 - #7795
Checklist
master
branch of Celery.contribution guide
on reporting bugs.
for similar or identical bug reports.
for existing proposed fixes.
to find out if the bug was already fixed in the master branch.
in this issue (If there are none, check this box anyway).
Mandatory Debugging Information
celery -A proj report
in the issue.(if you are not able to do this, then at least specify the Celery
version affected).
master
branch of Celery.pip freeze
in the issue.to reproduce this bug.
Optional Debugging Information
and/or implementation.
result backend.
broker and/or result backend.
ETA/Countdown & rate limits disabled.
and/or upgrading Celery and its dependencies.
Related Issues
Possible Duplicates
Environment & Settings
Celery version:
celery==4.3.1
redis==4.1.2
kombu==4.6.11
celery report
Output:Steps to Reproduce
Required Dependencies
Python Packages
pip freeze
Output:Other Dependencies
N/A
Minimally Reproducible Test Case
Expected Behavior
After a task is redelivered to new worker post visibility timeout, the task should be removed from previous worker's reserved list.
If a task is expired, it should not be executed by the worker.
Actual Behavior
A task is received by a worker but not executed. It then gets redelivered to a new worker after visibility timeout (3600). The new worker executes the task. And then, after 2-3 days, original worker also executed the task. (even though task has an expiration of 6 hours)
Logs:
worker32.log:[2022-11-14 14:53:33,063: INFO/MainProcess] Received task: task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] expires:[2022-11-14 20:53:32.659098+00:00]
[2022-11-18 00:02:33,906: INFO/ForkPoolWorker-732] Task task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] succeeded in 0.42657385021448135s:
worker33.log:[2022-11-14 15:53:36,000: INFO/MainProcess] Received task: task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] expires:[2022-11-14 20:53:32.659098+00:00]
[2022-11-14 15:53:37,000: INFO/ForkPoolWorker-64] Task task.version[82b3ff71-e5ec-xxxx-915a-ba102ff51xxx] succeeded in 0.2886648119892925s:
I checked another case currently going on - worker A has reserved a task, it got redelivered to new worker B after 1 hour (visibility timeout). Worker B executed the task. But the task is still reserved with the worker A for more than 2 days and not getting executed.
workerA: [2022-11-18 08:44:06,400: INFO/MainProcess] Received task: api.pkg.get_ticket_info[d7f42e6e-xxxx-471b-ba7d-14a6d666exxx] expires:[2022-11-18 14:44:06.140396+00:00]
user:/var/log/celery$ date
Sun Nov 20 17:36:23 UTC 2022
i.reserved()
{'workerA': [{'id': 'd7f42e6e-xxxx-471b-ba7d-14a6d666exxx', 'name': 'api.pkg.get_ticket_info', 'args': '()', 'kwargs': '{}', 'type': 'oapi.pkg.get_ticket_info', 'hostname': 'workerA', 'time_start': None, 'acknowledged': False, 'delivery_info': {'exchange': '', 'routing_key': 'hwproxyprod', 'priority': None, 'redelivered': None}, 'worker_pid': None}]}
workerB: [2022-11-18 09:44:07,886: INFO/MainProcess] Received task: api.pkg.get_ticket_info[d7f42e6e-xxxx-471b-ba7d-14a6d666exxx] expires:[2022-11-18 14:44:06.140396+00:00]
[2022-11-18 09:44:09,395: INFO/ForkPoolWorker-776] Task pi.pkg.get_ticket_info[d7f42e6e-xxxx-471b-ba7d-14a6d666exxx] succeeded in 1.293412797152996s: (True, {'url': 'xyz'})
The text was updated successfully, but these errors were encountered: