You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/04/24 15:04:05 UTC

[42/50] [abbrv] ignite git commit: ignite-3054 - Channel blocking workaround

ignite-3054 - Channel blocking workaround


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/6ff80d5e
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/6ff80d5e
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/6ff80d5e

Branch: refs/heads/ignite-3054
Commit: 6ff80d5e0f6d4c67f0c3148dc47f6bc5f706d634
Parents: 1196ebc
Author: dkarachentsev <dk...@gridgain.com>
Authored: Fri Dec 16 17:11:49 2016 +0300
Committer: dkarachentsev <dk...@gridgain.com>
Committed: Fri Dec 16 17:11:49 2016 +0300

----------------------------------------------------------------------
 .../org/apache/ignite/spi/discovery/tcp/ServerImpl.java     | 9 +++++++--
 .../communication/tcp/IgniteCacheSslStartStopSelfTest.java  | 4 ++++
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/6ff80d5e/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
index e9b218a..eb38765 100644
--- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/ServerImpl.java
@@ -30,11 +30,16 @@ import java.net.InetSocketAddress;
 import java.net.Socket;
 import java.net.SocketAddress;
 import java.net.SocketException;
+import java.net.SocketOption;
 import java.net.SocketTimeoutException;
 import java.net.StandardSocketOptions;
 import java.nio.ByteBuffer;
 import java.nio.ByteOrder;
 import java.nio.channels.AlreadyBoundException;
+import java.nio.channels.ByteChannel;
+import java.nio.channels.Channel;
+import java.nio.channels.Channels;
+import java.nio.channels.ReadableByteChannel;
 import java.nio.channels.ServerSocketChannel;
 import java.nio.channels.SocketChannel;
 import java.util.ArrayDeque;
@@ -7663,7 +7668,7 @@ class ServerImpl extends TcpDiscoveryImpl {
         private final InputStream in;
 
         /** */
-        private final SocketChannel ch;
+        private final ReadableByteChannel ch;
 
         /** */
         private final BlockingSslHandler sslHnd;
@@ -7681,7 +7686,7 @@ class ServerImpl extends TcpDiscoveryImpl {
          */
         SslInputStream(final InputStream in, final SocketChannel ch, final BlockingSslHandler sslHnd) {
             this.in = in;
-            this.ch = ch;
+            this.ch = Channels.newChannel(in);
             this.sslHnd = sslHnd;
 
             buf = ByteBuffer.allocate(32 * 1024);

http://git-wip-us.apache.org/repos/asf/ignite/blob/6ff80d5e/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
index 68a520b..651df66 100644
--- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/IgniteCacheSslStartStopSelfTest.java
@@ -20,6 +20,8 @@ package org.apache.ignite.spi.communication.tcp;
 import org.apache.ignite.cache.CacheAtomicityMode;
 import org.apache.ignite.configuration.IgniteConfiguration;
 import org.apache.ignite.internal.processors.cache.distributed.dht.IgniteCachePutRetryAbstractSelfTest;
+import org.apache.ignite.spi.discovery.DiscoverySpi;
+import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.testframework.GridTestUtils;
 
 import static org.apache.ignite.cache.CacheAtomicityMode.ATOMIC;
@@ -34,6 +36,8 @@ public class IgniteCacheSslStartStopSelfTest extends IgniteCachePutRetryAbstract
 
         cfg.setSslContextFactory(GridTestUtils.sslFactory());
 
+        ((TcpDiscoverySpi)cfg.getDiscoverySpi()).setStatisticsPrintFrequency(1000);
+
         return cfg;
     }