You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2015/12/18 23:40:39 UTC

nifi git commit: NIFI-1310: Do not yield context when encountering IOException and fixed bug that caused the penalization period for a node not to get set

Repository: nifi
Updated Branches:
  refs/heads/master 43c7ecd22 -> 0a58ab47b


NIFI-1310: Do not yield context when encountering IOException and fixed bug that caused the penalization period for a node not to get set

Signed-off-by: joewitt <jo...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/0a58ab47
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/0a58ab47
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/0a58ab47

Branch: refs/heads/master
Commit: 0a58ab47b96d1fdf5e283f4f7d0fa2a27f06d1c4
Parents: 43c7ecd
Author: Mark Payne <ma...@hotmail.com>
Authored: Fri Dec 18 17:06:11 2015 -0500
Committer: joewitt <jo...@apache.org>
Committed: Fri Dec 18 17:35:46 2015 -0500

----------------------------------------------------------------------
 .../java/org/apache/nifi/remote/StandardRemoteGroupPort.java   | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/0a58ab47/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java
index 773f9cf..d8f130e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-site-to-site/src/main/java/org/apache/nifi/remote/StandardRemoteGroupPort.java
@@ -125,12 +125,15 @@ public class StandardRemoteGroupPort extends RemoteGroupPort {
     public void onSchedulingStart() {
         super.onSchedulingStart();
 
+        final long penalizationMillis = FormatUtils.getTimeDuration(remoteGroup.getYieldDuration(), TimeUnit.MILLISECONDS);
+
         final SiteToSiteClient client = new SiteToSiteClient.Builder()
         .url(remoteGroup.getTargetUri().toString())
         .portIdentifier(getIdentifier())
         .sslContext(sslContext)
         .eventReporter(remoteGroup.getEventReporter())
         .peerPersistenceFile(getPeerPersistenceFile(getIdentifier()))
+        .nodePenalizationPeriod(penalizationMillis, TimeUnit.MILLISECONDS)
         .build();
         clientRef.set(client);
     }
@@ -182,7 +185,8 @@ public class StandardRemoteGroupPort extends RemoteGroupPort {
             remoteGroup.getEventReporter().reportEvent(Severity.ERROR, CATEGORY, message);
             return;
         } catch (final IOException e) {
-            context.yield();
+            // we do not yield here because the 'peer' will be penalized, and we won't communicate with that particular nifi instance
+            // for a while due to penalization, but we can continue to talk to other nifi instances
             final String message = String.format("%s failed to communicate with %s due to %s", this, url, e.toString());
             logger.error(message);
             if (logger.isDebugEnabled()) {