You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/08/22 09:06:10 UTC

[GitHub] Fokko closed pull request #3773: [AIRFLOW-2921][AIRFLOW-2922] Fix two potential bugs in CeleryExecutor()

Fokko closed pull request #3773: [AIRFLOW-2921][AIRFLOW-2922] Fix two potential bugs in CeleryExecutor()
URL: https://github.com/apache/incubator-airflow/pull/3773
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/executors/celery_executor.py b/airflow/executors/celery_executor.py
index d67f1105c6..2128ae7b09 100644
--- a/airflow/executors/celery_executor.py
+++ b/airflow/executors/celery_executor.py
@@ -104,8 +104,8 @@ def sync(self):
                         del self.tasks[key]
                         del self.last_state[key]
                     else:
-                        self.log.info("Unexpected state: %s", task.state)
-                    self.last_state[key] = task.state
+                        self.log.info("Unexpected state: %s", state)
+                        self.last_state[key] = state
             except Exception as e:
                 self.log.error("Error syncing the celery executor, ignoring it:")
                 self.log.exception(e)
diff --git a/tests/executors/test_celery_executor.py b/tests/executors/test_celery_executor.py
index 7e82e4b8ae..69f9fbfe9f 100644
--- a/tests/executors/test_celery_executor.py
+++ b/tests/executors/test_celery_executor.py
@@ -54,6 +54,8 @@ def test_celery_integration(self):
         self.assertNotIn('success', executor.tasks)
         self.assertNotIn('fail', executor.tasks)
 
+        self.assertNotIn('success', executor.last_state)
+        self.assertNotIn('fail', executor.last_state)
 
 if __name__ == '__main__':
     unittest.main()


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services