ashb 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_r327051504
########## 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: ```suggestion subprocess.check_call(["sudo", "--non-interactive", "-" + str(sig), str(os.getpgid(pid))]) ``` Please use long-form arguments in code, it's much easier to understand what it does then. Other than that this will be okay ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services