bharathpalaksha commented on a change in pull request #6026: [AIRFLOW-5419] -
Use `sudo` to kill cleared tasks when running with impersonation
URL: https://github.com/apache/airflow/pull/6026#discussion_r327053434
##########
File path: airflow/utils/helpers.py
##########
@@ -305,6 +306,9 @@ def on_terminate(p):
except OSError as err:
if err.errno == errno.ESRCH:
return
+ # If operation not permitted error is thrown due to run_as_user, use
sudo to kill the process
+ if err.errno == errno.EPERM:
+ subprocess.check_call(["sudo", "-n", "-" + str(sig),
str(os.getpgid(pid))])
Review comment:
But, sudo --non-interactive doesn't work on all Linux machines. I will try
again and will show the error message
----------------------------------------------------------------
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]
With regards,
Apache Git Services