{"action":"created","issue":{"url":"https://api.github.com/repos/celery/celery/issues/2481","labels_url":"https://api.github.com/repos/celery/celery/issues/2481/labels{/name}","comments_url":"https://api.github.com/repos/celery/celery/issues/2481/comments","events_url":"https://api.github.com/repos/celery/celery/issues/2481/events","html_url":"https://github.com/celery/celery/issues/2481","id":56375104,"number":2481,"title":"Celery multiplying unwanted tasks ","user":{"login":"Austriker","id":5080705,"avatar_url":"https://avatars.githubusercontent.com/u/5080705?v=3","gravatar_id":"","url":"https://api.github.com/users/Austriker","html_url":"https://github.com/Austriker","followers_url":"https://api.github.com/users/Austriker/followers","following_url":"https://api.github.com/users/Austriker/following{/other_user}","gists_url":"https://api.github.com/users/Austriker/gists{/gist_id}","starred_url":"https://api.github.com/users/Austriker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Austriker/subscriptions","organizations_url":"https://api.github.com/users/Austriker/orgs","repos_url":"https://api.github.com/users/Austriker/repos","events_url":"https://api.github.com/users/Austriker/events{/privacy}","received_events_url":"https://api.github.com/users/Austriker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-03T13:07:27Z","updated_at":"2015-04-16T15:17:28Z","closed_at":null,"body":"Hi,\r\n\r\nI am having an issue with celery. It keeps duplicating tasks with time. At the end I can end up with more than 20 copies of a tasks before the due date.\r\n\r\nI know it's not the django app that order (apply_sync) the task because i added a checkup to database to check if the task was created by the app.\r\n\r\nExtract from the logs : \r\n```python\r\n[2015-02-01 17:41:55,114: INFO/MainProcess] Received task: entreprises.tasks.Check_Beautician[0a0437f9-ff97-4167-a4f8-60bdd2695dd6] eta:[2015-02-01 19:40:17.121279+00:00]\r\n[2015-02-01 18:41:56,090: INFO/MainProcess] Received task: entreprises.tasks.Check_Beautician[0a0437f9-ff97-4167-a4f8-60bdd2695dd6] eta:[2015-02-01 19:40:17.121279+00:00]\r\n[2015-02-01 19:40:17,243: INFO/MainProcess] Task entreprises.tasks.Check_Beautician[0a0437f9-ff97-4167-a4f8-60bdd2695dd6] succeeded in 0.0493502870668s: None\r\n[2015-02-01 19:40:17,244: INFO/Worker-2] Check_Beautician : Current Task ID 0a0437f9-ff97-4167-a4f8-60bdd2695dd6\r\n[2015-02-01 19:40:17,264: INFO/Worker-2] No task for CheckBeautician in event : 14 for delete\r\n[2015-02-01 19:40:17,266: INFO/MainProcess] Task entreprises.tasks.Check_Beautician[0a0437f9-ff97-4167-a4f8-60bdd2695dd6] succeeded in 0.0228787132073s: None\r\n[2015-02-01 19:40:17,267: INFO/Worker-2] Check_Beautician : Current Task ID 0a0437f9-ff97-4167-a4f8-60bdd2695dd6\r\n[2015-02-01 19:40:17,288: INFO/Worker-2] No task for CheckBeautician in event : 14 for delete\r\n```\r\n\r\nThe task itself : \r\n```python\r\n#views.py\r\neta = datetime.datetime.now() + datetime.timedelta(hours=24)    \r\ntask_beautician = Check_Beautician.apply_async(eta=eta, kwargs={'event_pk': instance.pk})\r\nCheckBeautician.objects.create(task_id=task_beautician.id, event=instance)\r\n\r\n#tasks.py\r\n@task(bind=True)\r\ndef Check_Beautician(self, event_pk):\r\n    logger.info('Check_Beautician : Current Task ID %s' % self.request.id)\r\n    try:\r\n        current_task = CheckBeautician.objects.get(task_id=self.request.id)\r\n    except CheckBeautician.DoesNotExist:\r\n        logger.info('No task for CheckBeautician in event : %s for delete' % event_pk)\r\n```\r\n\r\nI use : \r\ndjango 1.7\r\ncelery 3.1.17\r\nredis\r\n\r\nHere is my settings : \r\n```python\r\n# Broker Configuration for celery\r\nBROKER_URL = 'redis://localhost:6379/0'\r\nBROKER_TRANSPORT = 'redis'\r\nBROKER_TRANSPORT_OPTIONS = {'visibility_timeout': 3600}  # 1 hour.\r\nCELERY_TASK_SERIALIZER='json'\r\nCELERY_ACCEPT_CONTENT=['json']  # Ignore other content\r\nCELERY_RESULT_SERIALIZER='json'\r\nCELERY_RESULT_BACKEND = 'redis://localhost:6379/0'\r\nCELERY_DEFAULT_QUEUE = 'prod'\r\nCELERY_QUEUES = (\r\n    Queue('prod', Exchange('prod_server'), routing_key='prod_server'),\r\n)\r\n```\r\n\r\nThe worker is configured like : \r\n```\r\nworker -A example --loglevel=INFO -Q prod -n worker2.example.com\r\n```\r\nI don't understand where this issue comes from ?\r\n\r\nSincerely,"},"comment":{"url":"https://api.github.com/repos/celery/celery/issues/comments/93760951","html_url":"https://github.com/celery/celery/issues/2481#issuecomment-93760951","issue_url":"https://api.github.com/repos/celery/celery/issues/2481","id":93760951,"user":{"login":"Austriker","id":5080705,"avatar_url":"https://avatars.githubusercontent.com/u/5080705?v=3","gravatar_id":"","url":"https://api.github.com/users/Austriker","html_url":"https://github.com/Austriker","followers_url":"https://api.github.com/users/Austriker/followers","following_url":"https://api.github.com/users/Austriker/following{/other_user}","gists_url":"https://api.github.com/users/Austriker/gists{/gist_id}","starred_url":"https://api.github.com/users/Austriker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Austriker/subscriptions","organizations_url":"https://api.github.com/users/Austriker/orgs","repos_url":"https://api.github.com/users/Austriker/repos","events_url":"https://api.github.com/users/Austriker/events{/privacy}","received_events_url":"https://api.github.com/users/Austriker/received_events","type":"User","site_admin":false},"created_at":"2015-04-16T15:17:28Z","updated_at":"2015-04-16T15:17:28Z","body":"Yeah I did the same thing."}}