Jarek Potiuk created AIRFLOW-3263:
-------------------------------------
Summary: CLI 'run' method sometimes exits with error when there is
a race on killing airflow job
Key: AIRFLOW-3263
URL: https://issues.apache.org/jira/browse/AIRFLOW-3263
Project: Apache Airflow
Issue Type: Bug
Components: cli
Reporter: Jarek Potiuk
Assignee: Jarek Potiuk
Sometimes when you run tasks from command line you get exit code = 1 due to
race condition (job runner tries to get process group from the process that has
already been terminated in the meantime)
This results in such exception:
Traceback (most recent call last):
File "/Users/potiuk/.virtualenvs/incubator-airflow/bin/airflow", line 7, in
<module>
exec(compile(f.read(), __file__, 'exec'))
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/bin/airflow",
line 32, in <module>
args.func(args)
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/utils/cli.py",
line 74, in wrapper
return f(*args, **kwargs)
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/bin/cli.py",
line 536, in run
_run(args, dag, ti)
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/bin/cli.py",
line 447, in _run
run_job.run()
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/jobs.py",
line 203, in run
self._execute()
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/jobs.py",
line 2666, in _execute
self.on_kill()
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/jobs.py",
line 2669, in on_kill
self.task_runner.terminate()
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/task/task_runner/standard_task_runner.py",
line 41, in terminate
reap_process_group(self.process.pid, self.log)
File
"/Users/potiuk/code/google-airflow-breeze/polidea/incubator-airflow/airflow/utils/helpers.py",
line 237, in reap_process_group
log.info("Sending %s to GPID %s", sig, os.getpgid(pid))
OSError: [Errno 3] No such process
I am going to provide a fix shortly.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)