steinitzu / celery-singleton

Seamlessly prevent duplicate executions of celery tasks
MIT License
240 stars 36 forks source link

Singleton killing worker when trying to retry a task #55

Open jsevillaamd opened 1 year ago

jsevillaamd commented 1 year ago

Singleton killing worker when trying to retry.

@shared_task(base=base_singleton, raise_on_duplicate=False, lock_expiry=21300, autoretry_for=(Exception,), max_retries=2)

If a task raises an exception, the worker is killed. This error appears en logs. celery.exceptions.Reject: (DuplicateTaskError('Attempted to queue a duplicate of task ID 2deba45b-f683-4f7a-bef1-f1df22b32895'), False) [2023-10-11 14:15:05,872: CRITICAL/MainProcess] Unrecoverable error: TypeError("init() missing 1 required positional argument: 'task_id'")