aljoscha commented on a change in pull request #10891: 
[FLINK-15561][Security][hotfix] Add Delegation Token checker in 
YarnClusterDescriptor
URL: https://github.com/apache/flink/pull/10891#discussion_r374031205
 
 

 ##########
 File path: 
flink-yarn/src/main/java/org/apache/flink/yarn/YarnClusterDescriptor.java
 ##########
 @@ -435,9 +436,13 @@ public void killCluster(ApplicationId applicationId) 
throws FlinkException {
                        UserGroupInformation loginUser = 
UserGroupInformation.getCurrentUser();
                        if (loginUser.getAuthenticationMethod() == 
UserGroupInformation.AuthenticationMethod.KERBEROS
                                        && useTicketCache && 
!loginUser.hasKerberosCredentials()) {
-                               LOG.error("Hadoop security with Kerberos is 
enabled but the login user does not have Kerberos credentials");
-                               throw new RuntimeException("Hadoop security 
with Kerberos is enabled but the login user " +
+                               // a delegation token is an adequate substitute 
in most cases
 
 Review comment:
   We could also move the whole block, i.e. 
   ```
   if (securityConfig.useTicketCache() && !loginUser.hasKerberosCredentials()) {
                                        // a delegation token is an adequate 
substitute in most cases
                                        if 
(!HadoopUtils.hasHDFSDelegationToken()) {
                                                LOG.warn("Hadoop security is 
enabled but current login user does not have Kerberos credentials");
                                        }
                                }
   ```
   to `HadoopUtils` and use it in both `HadoopModule` and this code, thus 
reducing code duplication.

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

Reply via email to