phill84 opened a new issue #9202:
URL: https://github.com/apache/airflow/issues/9202


   **Apache Airflow version**:
   1.10.9 until the current master (f4faed6eea70e34da60edcb555fffc9099d3214a)
   
   **What happened**:
   airflow fails to kill tasks executed with sudo
   ```
   Traceback (most recent call last):
     File "/opt/airflow/.venv/bin/airflow", line 37, in <module>
       args.func(args)
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/utils/cli.py", line 75, 
in wrapper
       return f(*args, **kwargs)
     File "/opt/airflow/.venv/lib/python3.6/site-packages/airflow/bin/cli.py", 
line 545, in run
       _run(args, dag, ti)
     File "/opt/airflow/.venv/lib/python3.6/site-packages/airflow/bin/cli.py", 
line 460, in _run
       run_job.run()
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/jobs/base_job.py", line 
221, in run
       self._execute()
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/jobs/local_task_job.py",
 line 127, in _execute
       self.on_kill()
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/jobs/local_task_job.py",
 line 130, in on_kill
       self.task_runner.terminate()
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/task/task_runner/standard_task_runner.py",
 line 104, in terminate
       rcs = reap_process_group(self.process.pid, self.log)
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/utils/helpers.py", line 
324, in reap_process_group
       signal_procs(sig)
     File 
"/opt/airflow/.venv/lib/python3.6/site-packages/airflow/utils/helpers.py", line 
299, in signal_procs
       ["sudo", "-n", "kill", "-" + str(sig)] + [str(p.pid) for p in children]
     File "/usr/lib64/python3.6/subprocess.py", line 291, in check_call
       raise CalledProcessError(retcode, cmd)
   subprocess.CalledProcessError: Command '['sudo', '-n', 'kill', 
'-Signals.SIGTERM', '16577', '16566']' returned non-zero exit status 1.
   ```
   
   **What you expected to happen**:
   ``kill`` should be invoked with the signal number
   
   **How to reproduce it**:
   Kick off any long running task that has ``run_as_user`` set to a different 
user than airflow worker and mark it as either success or failed in the admin 
UI.


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