This is an automated email from the ASF dual-hosted git repository.
exceptionfactory pushed a commit to branch support/nifi-1.x
in repository https://gitbox.apache.org/repos/asf/nifi.git
The following commit(s) were added to refs/heads/support/nifi-1.x by this push:
new bd26936f24 NIFI-11591: Added additional logging for
DynamicallyModifyClasspath system test
bd26936f24 is described below
commit bd26936f2432509d40b55008b547cdc8143429fb
Author: Mark Payne <[email protected]>
AuthorDate: Tue May 30 10:33:44 2023 -0400
NIFI-11591: Added additional logging for DynamicallyModifyClasspath system
test
This closes #7312
Signed-off-by: David Handermann <[email protected]>
(cherry picked from commit 4b7e20740e4777f6e64e69db7b0c597cc0fb7e5e)
---
.../org/apache/nifi/controller/queue/AbstractFlowFileQueue.java | 2 ++
.../nifi/processors/tests/system/DynamicallyModifyClasspath.java | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/AbstractFlowFileQueue.java
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/AbstractFlowFileQueue.java
index e4038603f8..235ffde0f0 100644
---
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/AbstractFlowFileQueue.java
+++
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/AbstractFlowFileQueue.java
@@ -287,6 +287,8 @@ public abstract class AbstractFlowFileQueue implements
FlowFileQueue {
dropRequest.setDroppedSize(originalSize);
dropRequest.setState(DropFlowFileState.COMPLETE);
dropRequestMap.put(requestIdentifier, dropRequest);
+
+ logger.info("No FlowFiles to drop from {} for request {} because
the queue is empty", this, requestIdentifier);
return dropRequest;
}
diff --git
a/nifi-system-tests/nifi-system-test-extensions-bundle/nifi-system-test-extensions/src/main/java/org/apache/nifi/processors/tests/system/DynamicallyModifyClasspath.java
b/nifi-system-tests/nifi-system-test-extensions-bundle/nifi-system-test-extensions/src/main/java/org/apache/nifi/processors/tests/system/DynamicallyModifyClasspath.java
index 3e77c010d4..ceaba50f97 100644
---
a/nifi-system-tests/nifi-system-test-extensions-bundle/nifi-system-test-extensions/src/main/java/org/apache/nifi/processors/tests/system/DynamicallyModifyClasspath.java
+++
b/nifi-system-tests/nifi-system-test-extensions-bundle/nifi-system-test-extensions/src/main/java/org/apache/nifi/processors/tests/system/DynamicallyModifyClasspath.java
@@ -98,11 +98,15 @@ public class DynamicallyModifyClasspath extends
AbstractProcessor {
final long sleepMillis =
context.getProperty(SLEEP_DURATION).evaluateAttributeExpressions(flowFile).asTimePeriod(TimeUnit.MILLISECONDS);
if (sleepMillis > 0) {
+ getLogger().info("Sleeping for {} millis", sleepMillis);
+
try {
Thread.sleep(sleepMillis);
} catch (final InterruptedException e) {
Thread.currentThread().interrupt();
}
+
+ getLogger().info("Finished sleeping");
}
final String classToLoad =
context.getProperty(CLASS_TO_LOAD).getValue();
@@ -118,8 +122,12 @@ public class DynamicallyModifyClasspath extends
AbstractProcessor {
}
session.transfer(flowFile, REL_SUCCESS);
+ getLogger().info("Transferred {} to success", flowFile);
} catch (final Exception e) {
+ getLogger().error("Failed to update {}", flowFile, e);
+
session.transfer(flowFile, REL_FAILURE);
+ getLogger().info("Transferred {} to failure", flowFile);
}
}
}