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 2016/03/13 18:45:51 UTC

[1/2] nifi git commit: NIFI-1612: Do not ignore Remote Process Group's timeout configuration

Repository: nifi
Updated Branches:
  refs/heads/master 730d999d4 -> 07d4d7005


NIFI-1612: Do not ignore Remote Process Group's timeout configuration

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/ce068ffc
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/ce068ffc
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/ce068ffc

Branch: refs/heads/master
Commit: ce068ffc6c4f9b979d2736b5c5527326f2d9c3a8
Parents: 730d999
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Mar 9 16:02:57 2016 -0500
Committer: joewitt <jo...@apache.org>
Committed: Sun Mar 13 13:40:45 2016 -0400

----------------------------------------------------------------------
 .../apache/nifi/remote/StandardRemoteGroupPort.java  | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/ce068ffc/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 d8f130e..552c0c6 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
@@ -128,13 +128,14 @@ public class StandardRemoteGroupPort extends RemoteGroupPort {
         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();
+            .url(remoteGroup.getTargetUri().toString())
+            .portIdentifier(getIdentifier())
+            .sslContext(sslContext)
+            .eventReporter(remoteGroup.getEventReporter())
+            .peerPersistenceFile(getPeerPersistenceFile(getIdentifier()))
+            .nodePenalizationPeriod(penalizationMillis, TimeUnit.MILLISECONDS)
+            .timeout(remoteGroup.getCommunicationsTimeout(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS)
+            .build();
         clientRef.set(client);
     }
 


[2/2] nifi git commit: NIFI-1612: Found a spot within the site-to-site client where the timeout was not utilized properly

Posted by jo...@apache.org.
NIFI-1612: Found a spot within the site-to-site client where the timeout was not utilized properly

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/07d4d700
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/07d4d700
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/07d4d700

Branch: refs/heads/master
Commit: 07d4d7005b9fbd1147eebce147f2e8172cf0a787
Parents: ce068ff
Author: Mark Payne <ma...@hotmail.com>
Authored: Wed Mar 9 17:32:41 2016 -0500
Committer: joewitt <jo...@apache.org>
Committed: Sun Mar 13 13:40:56 2016 -0400

----------------------------------------------------------------------
 .../nifi/remote/client/socket/EndpointConnectionPool.java       | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/07d4d700/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
----------------------------------------------------------------------
diff --git a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
index 0dde17d..1990a22 100644
--- a/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
+++ b/nifi-commons/nifi-site-to-site-client/src/main/java/org/apache/nifi/remote/client/socket/EndpointConnectionPool.java
@@ -708,7 +708,10 @@ public class EndpointConnectionPool {
                     throw new IOException(ex);
                 }
             } else {
-                final SocketChannel socketChannel = SocketChannel.open(new InetSocketAddress(hostname, port));
+                final SocketChannel socketChannel = SocketChannel.open();
+                socketChannel.socket().connect(new InetSocketAddress(hostname, port), commsTimeout);
+                socketChannel.socket().setSoTimeout(commsTimeout);
+
                 commsSession = new SocketChannelCommunicationsSession(socketChannel, destinationUri);
             }