You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/07/29 09:40:10 UTC

[GitHub] [airflow] uranusjr commented on a change in pull request #15947: Applied permissions to self._error_file

uranusjr commented on a change in pull request #15947:
URL: https://github.com/apache/airflow/pull/15947#discussion_r678993422



##########
File path: airflow/task/task_runner/base_task_runner.py
##########
@@ -85,6 +86,12 @@ def __init__(self, local_task_job):
             cfg_path = tmp_configuration_copy(chmod=0o600)
 
         self._error_file = NamedTemporaryFile(delete=True)
+        if self.run_as_user:
+            try:
+                os.chown(self._error_file.name, getpwnam(self.run_as_user).pw_uid, -1)
+            except Exception:
+                pass

Review comment:
       This should either bubble the exception or log that the chown failed. Personally I’d prefer *not* catching the exception for now and fix UX issues when someone complains.




-- 
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: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org