This is an automated email from the ASF dual-hosted git repository.
mattyb149 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/master by this push:
new 05de73d NIFI-5951 Fix error logging with rollback on failure
05de73d is described below
commit 05de73d6a0c53714f0c4accccc3704fc0eeeac96
Author: Koji Kawamura <[email protected]>
AuthorDate: Fri Jan 11 11:46:07 2019 +0900
NIFI-5951 Fix error logging with rollback on failure
Signed-off-by: Matthew Burgess <[email protected]>
This closes #3264
---
.../src/main/java/org/apache/nifi/processors/hive/PutHiveQL.java | 3 +++
.../main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java | 1 +
.../src/main/java/org/apache/nifi/processors/hive/PutHive3QL.java | 3 +++
.../src/main/java/org/apache/nifi/processors/standard/PutSQL.java | 3 +++
4 files changed, 10 insertions(+)
diff --git
a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveQL.java
b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveQL.java
index bb5d526..943e288 100644
---
a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveQL.java
+++
b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveQL.java
@@ -278,6 +278,9 @@ public class PutHiveQL extends AbstractHiveQLProcessor {
getLogger().error("Failed to update Hive for {} due to {};
it is possible that retrying the operation will succeed, so routing to retry",
new Object[] {i, e}, e);
break;
+ case Self:
+ getLogger().error("Failed to update Hive for {} due to
{};", new Object[] {i, e}, e);
+ break;
}
});
return RollbackOnFailure.createOnError(onFlowFileError);
diff --git
a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java
b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java
index 450f157..1627159 100644
---
a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java
+++
b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive-processors/src/main/java/org/apache/nifi/processors/hive/PutHiveStreaming.java
@@ -631,6 +631,7 @@ public class PutHiveStreaming extends
AbstractSessionFactoryProcessor {
throw new ShouldRetryException("Hive Streaming
connect/write error, flow file will be penalized and routed to retry. " + e, e);
case Self:
+ getLogger().error(String.format("Error writing %s to Hive
Streaming transaction due to %s", input, e), e);
abortAndCloseWriters(writers);
break;
diff --git
a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/PutHive3QL.java
b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/PutHive3QL.java
index 162d4fe..7a5b389 100644
---
a/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/PutHive3QL.java
+++
b/nifi-nar-bundles/nifi-hive-bundle/nifi-hive3-processors/src/main/java/org/apache/nifi/processors/hive/PutHive3QL.java
@@ -281,6 +281,9 @@ public class PutHive3QL extends AbstractHive3QLProcessor {
getLogger().error("Failed to update Hive for {} due to {};
it is possible that retrying the operation will succeed, so routing to retry",
new Object[] {i, e}, e);
break;
+ case Self:
+ getLogger().error("Failed to update Hive for {} due to
{};", new Object[] {i, e}, e);
+ break;
}
});
return RollbackOnFailure.createOnError(onFlowFileError);
diff --git
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java
index 38134c2..8834821 100644
---
a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java
+++
b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutSQL.java
@@ -452,6 +452,9 @@ public class PutSQL extends AbstractSessionFactoryProcessor
{
getLogger().error("Failed to update database for {} due to
{}; it is possible that retrying the operation will succeed, so routing to
retry",
new Object[] {i, e}, e);
break;
+ case Self:
+ getLogger().error("Failed to update database for {} due to
{};", new Object[] {i, e}, e);
+ break;
}
});
return RollbackOnFailure.createOnError(onFlowFileError);