youngyjd commented on issue #4916: [AIRFLOW-4087] remove sudo in on_finish function of BaseTaskRunner URL: https://github.com/apache/airflow/pull/4916#issuecomment-472686858 @XD-DENG I guess your situation only works when you run airflow worker command as root, and you provide `run_as_user` option to the task. If this situation you need to run `sudo chown` so that `run_as_user` can access the temp cfg file that is generated by root. However, as I said in the ticket, we use a non-root user (called `airflow`) to run airflow worker and did not provide `run_as_user` to any task. So the temp file is actually owned by `airflow` user, there is no way it will enter the if condition that you provided in our situation. Also, I did a git grep on the code base and the `on_finish` function is called a lot.
---------------------------------------------------------------- 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
