Github user bbende commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2681#discussion_r186478219
--- Diff:
nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/main/java/org/apache/nifi/processors/hadoop/MoveHDFS.java
---
@@ -228,14 +232,17 @@ public void onScheduled(ProcessContext context)
throws Exception {
@Override
public void onTrigger(ProcessContext context, ProcessSession session)
throws ProcessException {
- // MoveHDFS
- FlowFile parentFlowFile = session.get();
- if (parentFlowFile == null) {
+ FlowFile flowFile = session.get();
+
+ if (flowFile == null && context.hasIncomingConnection()) {
+ context.yield();
--- End diff --
I know this is a minor point, but we don't need to yield here. Unless a
processor has @TriggerWhenEmpty then it won't be scheduled unless there are
flow files in the queue so we don't have to work about repeatedly executing and
getting null. The case we can get null is when concurrent tasks is > 1 and one
tasks grabs the flow file and the other gets null.
---