youngyjd commented on a change in pull request #4916: [AIRFLOW-4087] remove 
sudo in on_finish function of BaseTaskRunner
URL: https://github.com/apache/airflow/pull/4916#discussion_r265379106
 
 

 ##########
 File path: airflow/task/task_runner/base_task_runner.py
 ##########
 @@ -161,4 +161,4 @@ def on_finish(self):
         A callback that should be called when this is done running.
         """
         if self._cfg_path and os.path.isfile(self._cfg_path):
-            subprocess.call(['sudo', 'rm', self._cfg_path], close_fds=True)
+            subprocess.call(['rm', self._cfg_path], close_fds=True)
 
 Review comment:
   so the temp cfg file is owned by the same user who runs airflow worker 
command, for example:
   ```
   jundayang@airflowinfraworker-production-iad-0184b3e28b386f0cf:/tmp$ ls -la 
tmpzyfuiw2v
   
   -rw------- 1 airflow airflow 7139 Mar 13 21:25 tmpzyfuiw2v
   ```
   At least we need to allow user who creates the file to delete the file?

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

Reply via email to