potiuk commented on a change in pull request #20147:
URL: https://github.com/apache/airflow/pull/20147#discussion_r831315397



##########
File path: airflow/task/task_runner/base_task_runner.py
##########
@@ -57,7 +57,8 @@ def __init__(self, local_task_job):
             except AirflowConfigException:
                 self.run_as_user = None
 
-        self._error_file = NamedTemporaryFile(delete=True)
+        self._error_file = NamedTemporaryFile(delete=False)

Review comment:
       Assuming that on_finish is called. There might be cases where it won't 
but the interpreter stops and the Temp file shold be deleted. 
   
   > However, in all cases the process that creates `_error_file` is not the 
same as the process that uses it. Both with and without impersonation the 
`_error_file` temporary file is being created and then the file name is being 
passed to another process and that other process will truncate and write to the 
file. Since the process that creates the file never uses the file, it should be 
closing it to remove its file handle.
   
   Have you looked at the "StandardTaskRunner" and fork behaviour (default) ?  
Are you absolutely sure it will work after forking ? From what I know child 
after fork inherits open files from parent and I believe we rely on this.




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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to