Github user jtstorck commented on a diff in the pull request: https://github.com/apache/nifi/pull/2971#discussion_r220204503 --- Diff: nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/PutHDFS.java --- @@ -389,16 +380,24 @@ public void process(InputStream in) throws IOException { session.transfer(putFlowFile, REL_SUCCESS); } catch (final Throwable t) { - if (tempDotCopyFile != null) { - try { - hdfs.delete(tempDotCopyFile, false); - } catch (Exception e) { - getLogger().error("Unable to remove temporary file {} due to {}", new Object[]{tempDotCopyFile, e}); - } + Optional<GSSException> causeOptional = findCause(t, GSSException.class, gsse -> GSSException.NO_CRED == gsse.getMajor()); --- End diff -- My previous comment was a bit ambiguous, I apologize. Having this logic in this catch for all Throwables is fine, but you could move this bit into a separate catch(IOException e) block of this try/catch.
---