From 3e12dad3f4b2e9db0da298636e98f8c8557cd9e6 Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Sun, 6 Sep 2020 13:42:00 -0400 Subject: [PATCH] ADD: Indico Patch --- .gitignore | 1 + celery/app/task.py | 6 ++++++ celery/backends/base.py | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/.gitignore b/.gitignore index 0a51be7b118..2893b158466 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ htmlcov/ coverage.xml test.db pip-wheel-metadata/ +.vscode/ diff --git a/celery/app/task.py b/celery/app/task.py index 86c4e727d49..b521907c335 100644 --- a/celery/app/task.py +++ b/celery/app/task.py @@ -1004,6 +1004,12 @@ def add_trail(self, result): return result def push_request(self, *args, **kwargs): + # indico + # we want access to args & kwargs in our copied context + # TODO: consider making a copy - need to make sure arguments are small enough + # to avoid dup mem. + self.request.args = args + self.request.kwargs = kwargs self.request_stack.push(Context(*args, **kwargs)) def pop_request(self): diff --git a/celery/backends/base.py b/celery/backends/base.py index 28e5b2a4d6b..97d4ca347a0 100644 --- a/celery/backends/base.py +++ b/celery/backends/base.py @@ -238,6 +238,12 @@ def chord_error_from_stack(self, callback, exc=None): # need below import for test for some crazy reason from celery import group # pylint: disable app = self.app + + # indico + # Revoke causes callbacks id to be None + if callback.id is None and callback.tasks: + callback.id = callback.tasks[0].id + try: backend = app._tasks[callback.task].backend except KeyError: