ashb commented on a change in pull request #6596: [AIRFLOW-6004] Untangle 
Executors class to avoid cyclic imports
URL: https://github.com/apache/airflow/pull/6596#discussion_r352499486
 
 

 ##########
 File path: airflow/executors/celery_executor.py
 ##########
 @@ -264,30 +284,45 @@ def sync(self):
                 )
                 continue
             key, state = key_and_state
-            try:
-                if self.last_state[key] != state:
-                    if state == celery_states.SUCCESS:
-                        self.success(key)
-                        del self.tasks[key]
-                        del self.last_state[key]
-                    elif state == celery_states.FAILURE:
-                        self.fail(key)
-                        del self.tasks[key]
-                        del self.last_state[key]
-                    elif state == celery_states.REVOKED:
-                        self.fail(key)
-                        del self.tasks[key]
-                        del self.last_state[key]
-                    else:
-                        self.log.info("Unexpected state: %s", state)
-                        self.last_state[key] = state
-            except Exception:
-                self.log.exception("Error syncing the Celery executor, 
ignoring it.")
-
-    def end(self, synchronous=False):
+            self.update_task_state(key, state)
+
+    # noinspection PyUnreachableCode
 
 Review comment:
   What does it think is unreachable in here? 🤔 

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


With regards,
Apache Git Services

Reply via email to