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 2020/05/28 17:20:25 UTC

[GitHub] [airflow] aneesh-joseph commented on a change in pull request #9044: do a kinit before yarn kill if keytab and principal are provided

aneesh-joseph commented on a change in pull request #9044:
URL: https://github.com/apache/airflow/pull/9044#discussion_r431999272



##########
File path: airflow/providers/apache/spark/hooks/spark_submit.py
##########
@@ -617,6 +617,13 @@ def on_kill(self):
             self._submit_sp.kill()
 
             if self._yarn_application_id:
+                if self._keytab is not None and self._principal is not None:
+                    kinit_cmd = "kinit -kt {} {}" \
+                        .format(self._keytab, self._principal).split()
+                    kinit = subprocess.Popen(kinit_cmd,
+                                             stdout=subprocess.PIPE,
+                                             stderr=subprocess.PIPE)

Review comment:
       @ashb  - tried using the `renew_from_kt` and it seems to do the following
   
   `kinit -r 3600m -k -t my.keytab -c /tmp/airflow_krb5_ccache principal`
   
   and then does a workaround to renew the ticket
   
   `kinit -c /tmp/airflow_krb5_ccache -R` 
   
   the latter seems to fail  for non-renewable tickets and does a `sys.exit`, any suggestions on how this can be handled? For a yarn kill, the renewal work around won't be needed 




----------------------------------------------------------------
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:
users@infra.apache.org