jedcunningham commented on a change in pull request #15263:
URL: https://github.com/apache/airflow/pull/15263#discussion_r612554731



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -589,6 +598,44 @@ def sync(self) -> None:
                 break
         # pylint: enable=too-many-nested-blocks
 
+        # Run any pending timed events
+        next_event = self.event_scheduler.run(blocking=False)
+        self.log.debug("Next timed event is in %f", next_event)
+
+    def _check_worker_pods_pending_timeout(self):
+        """Check if any pending worker pods have timed out"""
+        timeout = self.kube_config.worker_pods_pending_timeout
+        self.log.debug('Looking for pending worker pods older than %d 
seconds', timeout)
+
+        kwargs = {
+            'limit': self.kube_config.worker_pods_pending_timeout_batch_size,
+            'field_selector': 'status.phase=Pending',
+            'label_selector': f'airflow-worker={self.scheduler_job_id}',

Review comment:
       The only downside I can see with that is if you had more than 1 instance 
of Airflow running in a namespace, or on the cluster with multi-namespace mode, 
you could timeout other instances tasks. Assuming they all have the same 
timeout it's fine 🤠. Even scheduler_job_id is brittle, just less so. Do we have 
a better 'unique' something per instance we could use?




-- 
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:
[email protected]


Reply via email to