Github user jtstorck commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2971#discussion_r220206853
--- 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());
+ if (causeOptional.isPresent()) {
+ getLogger().warn(String.format("An error occured
while connecting to HDFS. "
--- End diff --
This could be changed to:
```java
getLogger().warn("An error occured while connecting to HDFS. Rolling back
session, and penalizing flow file {}",
new Object[] {putFlowFile.getAttribute(CoreAttributes.UUID.key()),
causeOptional.get()});
```
---