From 07d4d7005b9fbd1147eebce147f2e8172cf0a787 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Wed, 9 Mar 2016 17:32:41 -0500 Subject: [PATCH] NIFI-1612: Found a spot within the site-to-site client where the timeout was not utilized properly Signed-off-by: joewitt --- .../nifi/remote/client/socket/EndpointConnectionPool.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 0dde17dca7..1990a22fdf 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); }