adenes commented on a change in pull request #4868: URL: https://github.com/apache/nifi/pull/4868#discussion_r585881166
########## File path: nifi-nar-bundles/nifi-extension-utils/nifi-hadoop-utils/src/main/java/org/apache/nifi/hadoop/SecurityUtil.java ########## @@ -151,7 +151,19 @@ public static boolean isSecurityEnabled(final Configuration config) { public static <T> T callWithUgi(UserGroupInformation ugi, PrivilegedExceptionAction<T> action) throws IOException { try { - return ugi.doAs(action); + T result; + if (ugi == null) { + try { + result = action.run(); + } catch (RuntimeException re) { + throw re; + } catch (Exception e) { Review comment: I think `IOException` should be handled separately, thrown as-is without wrapping it in a `RuntimeException`. Adding `IOException` to the previous `catch` statement would be enough. ---------------------------------------------------------------- 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: us...@infra.apache.org