This is an automated email from the ASF dual-hosted git repository.

exceptionfactory pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/main by this push:
     new 25b6e2c9cd NIFI-10815 Fixed initial internal yield duration when 
processor created
25b6e2c9cd is described below

commit 25b6e2c9cd078c55d7d201a34d5e38f3d0300872
Author: Paul Grey <[email protected]>
AuthorDate: Mon Nov 14 17:41:46 2022 -0500

    NIFI-10815 Fixed initial internal yield duration when processor created
    
    This closes #6664
    
    Signed-off-by: David Handermann <[email protected]>
---
 .../main/java/org/apache/nifi/controller/StandardProcessorNode.java    | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
index 8f8445fc7e..5556e5a279 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-components/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
@@ -205,6 +205,7 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
         schedulingPeriod = new AtomicReference<>("0 sec");
         schedulingNanos = new AtomicLong(MINIMUM_SCHEDULING_NANOS);
         yieldPeriod = new AtomicReference<>(DEFAULT_YIELD_PERIOD);
+        yieldNanos = 
Math.round(FormatUtils.getPreciseTimeDuration(DEFAULT_YIELD_PERIOD, 
TimeUnit.NANOSECONDS));
         yieldExpiration = new AtomicLong(0L);
         concurrentTaskCount = new AtomicInteger(1);
         position = new AtomicReference<>(new Position(0D, 0D));
@@ -596,7 +597,7 @@ public class StandardProcessorNode extends ProcessorNode 
implements Connectable
     public void yield() {
         final Processor processor = processorRef.get().getProcessor();
         final long yieldMillis = getYieldPeriod(TimeUnit.MILLISECONDS);
-        yield(yieldMillis, TimeUnit.MILLISECONDS);
+        this.yield(yieldMillis, TimeUnit.MILLISECONDS);
 
         final String yieldDuration = (yieldMillis > 1000) ? (yieldMillis / 
1000) + " seconds" : yieldMillis + " milliseconds";
         LoggerFactory.getLogger(processor.getClass()).trace("{} has chosen to 
yield its resources; will not be scheduled to run again for {}", processor, 
yieldDuration);

Reply via email to