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 2021/02/03 01:31:24 UTC

[GitHub] [airflow] jedcunningham commented on issue #11982: Scheduler not exiting after SIGTERM with KubeExecutor

jedcunningham commented on issue #11982:
URL: https://github.com/apache/airflow/issues/11982#issuecomment-772130745


   @ashb, finally got back to this... I noticed that KubeExecutors end method isn't being called. I naively tried this:
   
   ```
   --- a/airflow/jobs/scheduler_job.py
   +++ b/airflow/jobs/scheduler_job.py
   @@ -1286,13 +1286,12 @@ class SchedulerJob(BaseJob):  # pylint: disable=too-many-instance-attributes
                    )
                    models.DAG.deactivate_stale_dags(execute_start_time)
    
   -            self.executor.end()
   -
                settings.Session.remove()  # type: ignore
            except Exception:  # pylint: disable=broad-except
                self.log.exception("Exception when executing SchedulerJob._run_scheduler_loop")
            finally:
                self.processor_agent.end()
   +            self.executor.end()
                self.log.info("Exited execute loop")
    
        @staticmethod
    ```
   
   This allowed it to exit, though I'm sure there are some scenarios where this may be lacking 🤠 Tests pass though 🤷‍♂️


----------------------------------------------------------------
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:
users@infra.apache.org