Lehel44 commented on code in PR #8497:
URL: https://github.com/apache/nifi/pull/8497#discussion_r1527391531


##########
nifi-nar-bundles/nifi-iceberg-bundle/nifi-iceberg-common/src/main/java/org/apache/nifi/processors/iceberg/AbstractIcebergProcessor.java:
##########
@@ -124,10 +124,16 @@ public void onTrigger(ProcessContext context, 
ProcessSession session) throws Pro
 
     @Override
     public String getClassloaderIsolationKey(PropertyContext context) {
-        final KerberosUserService kerberosUserService = 
context.getProperty(KERBEROS_USER_SERVICE).asControllerService(KerberosUserService.class);
-        if (kerberosUserService != null) {
-            return kerberosUserService.getIdentifier();
+        try {
+            final KerberosUserService kerberosUserService = 
context.getProperty(KERBEROS_USER_SERVICE).asControllerService(KerberosUserService.class);
+            if (kerberosUserService != null) {
+                final KerberosUser kerberosUser = 
kerberosUserService.createKerberosUser();
+                return kerberosUser.getPrincipal();
+            }
+        } catch (IllegalStateException e) {

Review Comment:
   Maybe catching a wider range of Exception here would be beneficial unless we 
are sure inly IllegalException can be thrown. 



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