o-nikolas commented on code in PR #41625:
URL: https://github.com/apache/airflow/pull/41625#discussion_r1724052994


##########
airflow/jobs/scheduler_job_runner.py:
##########
@@ -739,9 +739,18 @@ def _process_task_event_logs(log_records: deque[Log], 
session: Session):
         session.bulk_save_objects(objects=objects, preserve_order=False)
 
     def _process_executor_events(self, executor: BaseExecutor, session: 
Session) -> int:
-        """Respond to executor events."""
         if not self._standalone_dag_processor and not self.processor_agent:
             raise ValueError("Processor agent is not started.")
+
+        return SchedulerJobRunner.process_executor_events(
+            executor=executor, dag_bag=self.dagbag, job_id=self.job.id, 
session=session
+        )
+
+    @classmethod
+    def process_executor_events(
+        cls, executor: BaseExecutor, dag_bag: DagBag, job_id: str | None, 
session: Session
+    ) -> int:
+        """Respond to executor events."""

Review Comment:
   Looks good but it's a little strange to have that logic as a classmethod, I 
obviously see the convenience though. Maybe update the docstring to explain 
more about why this is a classmethod and where it's used elsewhere in the code 
(i.e. dag.test).



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to