{"action":"closed","issue":{"url":"https://api.github.com/repos/celery/celery/issues/2944","labels_url":"https://api.github.com/repos/celery/celery/issues/2944/labels{/name}","comments_url":"https://api.github.com/repos/celery/celery/issues/2944/comments","events_url":"https://api.github.com/repos/celery/celery/issues/2944/events","html_url":"https://github.com/celery/celery/issues/2944","id":119817370,"number":2944,"title":"Reject exception doesn't cause the task to fail","user":{"login":"mhnagaoka","id":903837,"avatar_url":"https://avatars.githubusercontent.com/u/903837?v=3","gravatar_id":"","url":"https://api.github.com/users/mhnagaoka","html_url":"https://github.com/mhnagaoka","followers_url":"https://api.github.com/users/mhnagaoka/followers","following_url":"https://api.github.com/users/mhnagaoka/following{/other_user}","gists_url":"https://api.github.com/users/mhnagaoka/gists{/gist_id}","starred_url":"https://api.github.com/users/mhnagaoka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhnagaoka/subscriptions","organizations_url":"https://api.github.com/users/mhnagaoka/orgs","repos_url":"https://api.github.com/users/mhnagaoka/repos","events_url":"https://api.github.com/users/mhnagaoka/events{/privacy}","received_events_url":"https://api.github.com/users/mhnagaoka/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-12-01T21:58:18Z","updated_at":"2015-12-11T21:53:45Z","closed_at":"2015-12-11T21:53:45Z","body":"I have a simple worker that rejects the task in case of an exception (such as `ZeroDivisionError`):\r\n\r\n```\r\n@app.task(bind=True, max_retries=0)\r\ndef invert(*args, **kwargs):\r\n    try:\r\n        x = float(kwargs['x'])\r\n        logging.info(\"x=%f\", x)\r\n        result = 1.0 / float(x)\r\n        logging.info(\"Result=%f\", result)\r\n    except Exception as e:\r\n        raise Reject(e) from e\r\n```\r\n\r\nBy running this worker and monitoring the outcome of the tasks using Celery Flower, I noticed that with Celery 3.1.16, the `Reject` exception causes the task to fail (`FAILURE` state), but with Celery 3.1.19 (actually 3.1.17+), the same exception does not change the task's state (it is kept in `STARTED` state).\r\n\r\nI put together a simple project to help reproducing the problem: https://github.com/Arizona-Tecnologia/celery-lab\r\n\r\nPlease let me know if this is \"by design\" or was an unintended regression (perhaps related to #2043 ?)"}}