ashb commented on a change in pull request #3873: [Airflow-2760] Decouple DAG
parsing loop from scheduler loop
URL: https://github.com/apache/incubator-airflow/pull/3873#discussion_r219588160
##########
File path: airflow/jobs.py
##########
@@ -579,26 +583,27 @@ def __init__(
self.using_sqlite = False
if 'sqlite' in conf.get('core', 'sql_alchemy_conn'):
- if self.max_threads > 1:
- self.log.error("Cannot use more than 1 thread when using
sqlite. Setting max_threads to 1")
- self.max_threads = 1
self.using_sqlite = True
- # How often to scan the DAGs directory for new files. Default to 5
minutes.
- self.dag_dir_list_interval = conf.getint('scheduler',
- 'dag_dir_list_interval')
- # How often to print out DAG file processing stats to the log. Default
to
- # 30 seconds.
- self.print_stats_interval = conf.getint('scheduler',
- 'print_stats_interval')
-
- self.file_process_interval = file_process_interval
-
self.max_tis_per_query = conf.getint('scheduler', 'max_tis_per_query')
if run_duration is None:
self.run_duration = conf.getint('scheduler',
'run_duration')
+ self.processor_agent = None
+
+ signal.signal(signal.SIGINT, self._exit_gracefully)
+ signal.signal(signal.SIGTERM, self._exit_gracefully)
+
+ def _exit_gracefully(self, signum, frame):
+ """
+ Helper method to clean up processor_agent to avoid leaving orphan
processes.
+ """
+ self.log.info("Exiting gracefully with signal {}".format(signum))
Review comment:
Nit: `"Exiting gracefully after receiving signal {}"` please
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services