From dec98886f591f663a598ca481226ae553ee52e24 Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Fri, 10 Aug 2018 14:23:37 +0300 Subject: [PATCH 01/10] IGNITE-11288 Add support for soLinger configuration in TcpDiscoverySpi and TcpCommunicationSpi. --- .../internal/util/nio/GridNioServer.java | 24 ++++++++++++ .../tcp/TcpCommunicationSpi.java | 38 +++++++++++++++++++ .../tcp/TcpCommunicationSpiMBean.java | 8 ++++ .../ignite/spi/discovery/tcp/ServerImpl.java | 1 + .../spi/discovery/tcp/TcpDiscoverySpi.java | 28 ++++++++++++++ .../internal/util/nio/GridNioSelfTest.java | 28 ++++++++++++++ 6 files changed, 127 insertions(+) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 794c8fcc50c44..891cb847b5908 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -104,6 +104,9 @@ public class GridNioServer { /** Default send queue limit. */ public static final int DFLT_SEND_QUEUE_LIMIT = 0; + /** Default SO_LINGER option for sockets. */ + public static final int DFLT_SO_LINGER = 0; + /** Time, which server will wait before retry operation. */ private static final long ERR_WAIT_TIME = 2000; @@ -183,6 +186,9 @@ public class GridNioServer { /** Tcp no delay flag. */ private final boolean tcpNoDelay; + /** SO_LINGER option to set for accepted sockets, set negative to disable. */ + private int soLinger = DFLT_SO_LINGER; + /** Socket send buffer. */ private final int sockSndBuf; @@ -259,6 +265,7 @@ public class GridNioServer { * falling into {@code selector.select(long)} in NIO server. Long value. Default is {@code 0}. * Can be set to {@code Long.MAX_VALUE} so selector threads will never block. * @param tcpNoDelay If TCP_NODELAY option should be set to accepted sockets. + * @param soLinger SO_LINGER option for accepted sockets. * @param directBuf Direct buffer flag. * @param order Byte order. * @param lsnr Listener. @@ -285,6 +292,7 @@ private GridNioServer( @Nullable String srvName, long selectorSpins, boolean tcpNoDelay, + int soLinger, boolean directBuf, ByteOrder order, GridNioServerListener lsnr, @@ -318,6 +326,7 @@ private GridNioServer( this.directBuf = directBuf; this.order = order; this.tcpNoDelay = tcpNoDelay; + this.soLinger = soLinger; this.sockRcvBuf = sockRcvBuf; this.sockSndBuf = sockSndBuf; this.sndQueueLimit = sndQueueLimit; @@ -3022,6 +3031,7 @@ private void processSelectedKeys(Set keys) throws IOException { sockCh.configureBlocking(false); sockCh.socket().setTcpNoDelay(tcpNoDelay); sockCh.socket().setKeepAlive(true); + sockCh.socket().setSoLinger(soLinger >= 0, soLinger); if (sockSndBuf > 0) sockCh.socket().setSendBufferSize(sockSndBuf); @@ -3624,6 +3634,9 @@ public static class Builder { /** TCP_NO_DELAY flag. */ private boolean tcpNoDelay; + /** SO_LINGER value for set fo . */ + private int soLinger; + /** Direct buffer flag. */ private boolean directBuf; @@ -3697,6 +3710,7 @@ public GridNioServer build() throws IgniteCheckedException { srvName, selectorSpins, tcpNoDelay, + soLinger, directBuf, byteOrder, lsnr, @@ -3816,6 +3830,16 @@ public Builder tcpNoDelay(boolean tcpNoDelay) { return this; } + /** + * @param soLinger Set SO_LINGER option to accepted sockets. + * @return This for chaining. + */ + public Builder soLinger(int soLinger) { + this.soLinger = soLinger; + + return this; + } + /** * @param directBuf Whether to use direct buffer. * @return This for chaining. diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index 15bc0d5fa0430..19e6f234bea3b 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -359,6 +359,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati /** Default value for {@code TCP_NODELAY} socket option (value is true). */ public static final boolean DFLT_TCP_NODELAY = true; + /** Default SO_LINGER to set for socket, 0 means enabled with zero timeout. */ + public static final int DFLT_SO_LINGER = 0; + /** Default value for {@code FILTER_REACHABLE_ADDRESSES} socket option (value is false). */ public static final boolean DFLT_FILTER_REACHABLE_ADDRESSES = false; @@ -1153,6 +1156,9 @@ class ConnectClosure implements IgniteInClosure { /** {@code TCP_NODELAY} option value for created sockets. */ private boolean tcpNoDelay = DFLT_TCP_NODELAY; + /** {@code SO_LINGER} option value for created sockets. */ + private int soLinger = DFLT_SO_LINGER; + /** {@code FILTER_REACHABLE_ADDRESSES} option value for created sockets. */ private boolean filterReachableAddresses = DFLT_FILTER_REACHABLE_ADDRESSES; @@ -1758,6 +1764,30 @@ public boolean isTcpNoDelay() { return tcpNoDelay; } + /** + * Sets value for {@code SO_LINGER} socket option. Each + * socket will be opened using provided value. + *

+ * Setting non-negative option to will enable SO_LINGER to close sockets in predictable timeout in seconds. + * Setting negative option will disable this. + *

+ * + * @param soLinger SoLinger value to set. + */ + @IgniteSpiConfiguration(optional = true) + public void setSoLinger(int soLinger) { + this.soLinger = soLinger; + } + + /** + * Gets value for {@code SO_LINGER} socket option. + * + * @return SO_LINGER value for sockets. + */ + public int getSoLinger() { + return soLinger; + } + /** * Gets value for {@code FILTER_REACHABLE_ADDRESSES} socket option. * @@ -2215,6 +2245,7 @@ public int boundPort() { log.debug(configInfo("directSendBuf", directSndBuf)); log.debug(configInfo("selectorsCnt", selectorsCnt)); log.debug(configInfo("tcpNoDelay", tcpNoDelay)); + log.debug(configInfo("soLinger", soLinger)); log.debug(configInfo("sockSndBuf", sockSndBuf)); log.debug(configInfo("sockRcvBuf", sockRcvBuf)); log.debug(configInfo("shmemPort", shmemPort)); @@ -2436,6 +2467,7 @@ private GridNioServer resetNioServer() throws IgniteCheckedException { .igniteInstanceName(igniteInstanceName) .serverName("tcp-comm") .tcpNoDelay(tcpNoDelay) + .soLinger(soLinger) .directBuffer(directBuf) .byteOrder(ByteOrder.nativeOrder()) .socketSendBufferSize(sockSndBuf) @@ -3318,6 +3350,7 @@ protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) ch.socket().setTcpNoDelay(tcpNoDelay); ch.socket().setKeepAlive(true); + ch.socket().setSoLinger(getSoLinger() >= 0, getSoLinger()); if (sockRcvBuf > 0) ch.socket().setReceiveBufferSize(sockRcvBuf); @@ -4982,6 +5015,11 @@ private class TcpCommunicationSpiMBeanImpl extends IgniteSpiMBeanAdapter impleme return TcpCommunicationSpi.this.isTcpNoDelay(); } + /** {@inheritDoc} */ + @Override public int getSoLinger() { + return TcpCommunicationSpi.this.getSoLinger(); + } + /** {@inheritDoc} */ @Override public int getSocketReceiveBuffer() { return TcpCommunicationSpi.this.getSocketReceiveBuffer(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java index ca144c0c4972c..cfb8ed5751290 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java @@ -232,6 +232,14 @@ public interface TcpCommunicationSpiMBean extends IgniteSpiManagementMBean { @MXBeanDescription("TCP_NODELAY socket option value.") public boolean isTcpNoDelay(); + /** + * Gets value for {@code SO_LINGER} socket option. + * + * @return Negative value is SO_LINGER is disabled. + */ + @MXBeanDescription("SO_LINGER socket option value.") + public int getSoLinger(); + /** * Gets flag defining whether direct send buffer should be used. * 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 e1577fb65bd83..c3b704a2fd81f 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 @@ -6158,6 +6158,7 @@ private class SocketReader extends IgniteSpiThread { // Set socket options. sock.setKeepAlive(true); sock.setTcpNoDelay(true); + sock.setSoLinger(spi.getSoLinger() >= 0, spi.getSoLinger()); int timeout = sock.getSoTimeout(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java index eba857249e3eb..aaca162c74ca4 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java @@ -279,6 +279,9 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements IgniteDiscovery /** Maximum ack timeout value for receiving message acknowledgement in milliseconds (value is 600,000ms). */ public static final long DFLT_MAX_ACK_TIMEOUT = 10 * 60 * 1000; + /** Default SO_LINGER to set for socket, 0 means enabled with 0 timeout. */ + public static final int DFLT_SO_LINGER = 0; + /** Default connection recovery timeout in ms. */ public static final long DFLT_CONNECTION_RECOVERY_TIMEOUT = IgniteConfiguration.DFLT_FAILURE_DETECTION_TIMEOUT; @@ -372,6 +375,9 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements IgniteDiscovery /** Maximum message acknowledgement timeout. */ private long maxAckTimeout = DFLT_MAX_ACK_TIMEOUT; + /** Default SO_LINGER to use for socket. Set negative to disable, non-negative to enable, default is {@DFLT_SO_LINGER }. */ + private int soLinger = DFLT_SO_LINGER; + /** IP finder clean frequency. */ protected long ipFinderCleanFreq = DFLT_IP_FINDER_CLEAN_FREQ; @@ -919,6 +925,17 @@ public TcpDiscoverySpi setAckTimeout(long ackTimeout) { return this; } + /** + * Sets SO_LINGER to use for all created sockets. + *

+ * If not specified, default is {@link #DFLT_SO_LINGER} + *

+ */ + @IgniteSpiConfiguration(optional = true) + public void setSoLinger(int soLinger) { + this.soLinger = soLinger; + } + /** * Sets maximum network timeout to use for network operations. *

@@ -1253,6 +1270,15 @@ public long getAckTimeout() { return ackTimeout; } + /** + * Gets SO_LINGER timeout for socket. + * + * @return SO_LINGER timeout for socket. + */ + public int getSoLinger() { + return soLinger; + } + /** * Gets network timeout. * @@ -1541,6 +1567,8 @@ Socket createSocket() throws IOException { sock.setTcpNoDelay(true); + sock.setSoLinger(getSoLinger() >= 0, getSoLinger()); + return sock; } catch (IOException e) { if (sock != null) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java index e8726fd304224..559ca7ecb6921 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java @@ -53,6 +53,7 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; import org.junit.Test; +import org.mockito.internal.util.reflection.Whitebox; import static java.util.concurrent.TimeUnit.SECONDS; @@ -87,6 +88,9 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** Test port. */ private static int port; + /** SO_LINGER value*/ + private int soLinger; + /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { getTestResources().startThreads(true); @@ -101,6 +105,12 @@ public class GridNioSelfTest extends GridCommonAbstractTest { getTestResources().stopThreads(); } + @Override protected void beforeTest() throws Exception { + super.beforeTest(); + + soLinger = GridNioServer.DFLT_SO_LINGER; + } + /** * @throws Exception If failed. */ @@ -219,6 +229,21 @@ public void testServerShutdown() throws Exception { */ @Test public void testCorrectSocketClose() throws Exception { + correctSocketClose(0); + } + + /** + * @throws Exception If failed. + */ + @Test + public void testCorrectSocketCloseCustomSoLinger() throws Exception { + soLinger = 5; + + correctSocketClose(5); + } + + /** */ + private void correctSocketClose(int expectedSoLinger) throws Exception { final AtomicReference err = new AtomicReference<>(); GridNioServerListener lsnr = new GridNioServerListenerAdapter() { @@ -239,6 +264,8 @@ public void testCorrectSocketClose() throws Exception { GridNioServer srvr = startServer(new GridPlainParser(), lsnr); + assertEquals(expectedSoLinger, Whitebox.getInternalState(srvr, "soLinger")); + try { Socket s = createSocket(); @@ -627,6 +654,7 @@ protected GridNioServer.Builder serverBuilder(int port, .selectorCount(Runtime.getRuntime().availableProcessors()) .igniteInstanceName("nio-test-grid") .tcpNoDelay(true) + .soLinger(soLinger) .directBuffer(true) .byteOrder(ByteOrder.nativeOrder()) .socketSendBufferSize(0) From 3261289672d4da18f41e4e0b59cac80eb01b6965 Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Fri, 10 Aug 2018 14:23:37 +0300 Subject: [PATCH 02/10] IGNITE-11288 Changed SO_LINGER default. --- .../java/org/apache/ignite/internal/util/nio/GridNioServer.java | 2 +- .../ignite/spi/communication/tcp/TcpCommunicationSpi.java | 2 +- .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 891cb847b5908..1edfb255e931c 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -105,7 +105,7 @@ public class GridNioServer { public static final int DFLT_SEND_QUEUE_LIMIT = 0; /** Default SO_LINGER option for sockets. */ - public static final int DFLT_SO_LINGER = 0; + public static final int DFLT_SO_LINGER = 5; /** Time, which server will wait before retry operation. */ private static final long ERR_WAIT_TIME = 2000; diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index 19e6f234bea3b..cc57d8f0ed3f5 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -360,7 +360,7 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati public static final boolean DFLT_TCP_NODELAY = true; /** Default SO_LINGER to set for socket, 0 means enabled with zero timeout. */ - public static final int DFLT_SO_LINGER = 0; + public static final int DFLT_SO_LINGER = 5; /** Default value for {@code FILTER_REACHABLE_ADDRESSES} socket option (value is false). */ public static final boolean DFLT_FILTER_REACHABLE_ADDRESSES = false; diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java index aaca162c74ca4..c2c22b9a66122 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java @@ -280,7 +280,7 @@ public class TcpDiscoverySpi extends IgniteSpiAdapter implements IgniteDiscovery public static final long DFLT_MAX_ACK_TIMEOUT = 10 * 60 * 1000; /** Default SO_LINGER to set for socket, 0 means enabled with 0 timeout. */ - public static final int DFLT_SO_LINGER = 0; + public static final int DFLT_SO_LINGER = 5; /** Default connection recovery timeout in ms. */ public static final long DFLT_CONNECTION_RECOVERY_TIMEOUT = IgniteConfiguration.DFLT_FAILURE_DETECTION_TIMEOUT; From be88dad1064aa31525625ea709b003c1b459ff65 Mon Sep 17 00:00:00 2001 From: Evgenii Zhuravlev Date: Fri, 10 Aug 2018 14:23:37 +0300 Subject: [PATCH 03/10] IGNITE-11288 Changed SO_LINGER default. --- .../internal/util/nio/GridNioSelfTest.java | 28 ------------------- 1 file changed, 28 deletions(-) diff --git a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java index 559ca7ecb6921..e8726fd304224 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/util/nio/GridNioSelfTest.java @@ -53,7 +53,6 @@ import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest; import org.jetbrains.annotations.Nullable; import org.junit.Test; -import org.mockito.internal.util.reflection.Whitebox; import static java.util.concurrent.TimeUnit.SECONDS; @@ -88,9 +87,6 @@ public class GridNioSelfTest extends GridCommonAbstractTest { /** Test port. */ private static int port; - /** SO_LINGER value*/ - private int soLinger; - /** {@inheritDoc} */ @Override protected void beforeTestsStarted() throws Exception { getTestResources().startThreads(true); @@ -105,12 +101,6 @@ public class GridNioSelfTest extends GridCommonAbstractTest { getTestResources().stopThreads(); } - @Override protected void beforeTest() throws Exception { - super.beforeTest(); - - soLinger = GridNioServer.DFLT_SO_LINGER; - } - /** * @throws Exception If failed. */ @@ -229,21 +219,6 @@ public void testServerShutdown() throws Exception { */ @Test public void testCorrectSocketClose() throws Exception { - correctSocketClose(0); - } - - /** - * @throws Exception If failed. - */ - @Test - public void testCorrectSocketCloseCustomSoLinger() throws Exception { - soLinger = 5; - - correctSocketClose(5); - } - - /** */ - private void correctSocketClose(int expectedSoLinger) throws Exception { final AtomicReference err = new AtomicReference<>(); GridNioServerListener lsnr = new GridNioServerListenerAdapter() { @@ -264,8 +239,6 @@ private void correctSocketClose(int expectedSoLinger) throws Exception { GridNioServer srvr = startServer(new GridPlainParser(), lsnr); - assertEquals(expectedSoLinger, Whitebox.getInternalState(srvr, "soLinger")); - try { Socket s = createSocket(); @@ -654,7 +627,6 @@ protected GridNioServer.Builder serverBuilder(int port, .selectorCount(Runtime.getRuntime().availableProcessors()) .igniteInstanceName("nio-test-grid") .tcpNoDelay(true) - .soLinger(soLinger) .directBuffer(true) .byteOrder(ByteOrder.nativeOrder()) .socketSendBufferSize(0) From cb1fffab27d71e66d644bceadd603ed11caf1bbb Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Fri, 10 Aug 2018 14:23:37 +0300 Subject: [PATCH 04/10] IGNITE-11288 Changed SO_LINGER default. --- .../org/apache/ignite/internal/util/nio/GridNioServer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index 1edfb255e931c..cbf1b57f15531 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -105,7 +105,7 @@ public class GridNioServer { public static final int DFLT_SEND_QUEUE_LIMIT = 0; /** Default SO_LINGER option for sockets. */ - public static final int DFLT_SO_LINGER = 5; + private static final int DFLT_SO_LINGER = 5; /** Time, which server will wait before retry operation. */ private static final long ERR_WAIT_TIME = 2000; @@ -3635,7 +3635,7 @@ public static class Builder { private boolean tcpNoDelay; /** SO_LINGER value for set fo . */ - private int soLinger; + private int soLinger = DFLT_SO_LINGER; /** Direct buffer flag. */ private boolean directBuf; From bfc003d3e29263f6343e05baa53c04134bfa540f Mon Sep 17 00:00:00 2001 From: Evgenii Zhuravlev Date: Fri, 10 Aug 2018 14:23:37 +0300 Subject: [PATCH 05/10] IGNITE-11288 Fix parity tests. --- .../ApiParity/TcpCommunicationSpiParityTest.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs index be8bd11af6487..e767e90291a07 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs @@ -65,7 +65,9 @@ public class TcpCommunicationSpiParityTest }; /** Properties that are missing on .NET side. */ - private static readonly string[] MissingProperties = {}; + private static readonly string[] MissingProperties = { + "soLinger" + }; ///

/// Tests the cache configuration parity. From 51d7ec8734efd00b0b39c1bdfafa6bd36ed92ec1 Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Tue, 12 Feb 2019 12:50:37 +0300 Subject: [PATCH 06/10] Revert soLinger to Disco only. --- .../internal/util/nio/GridNioServer.java | 24 ------------ .../tcp/TcpCommunicationSpi.java | 38 ------------------- .../tcp/TcpCommunicationSpiMBean.java | 8 ---- .../ignite/spi/discovery/tcp/ServerImpl.java | 1 - .../spi/discovery/tcp/TcpDiscoverySpi.java | 2 + 5 files changed, 2 insertions(+), 71 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java index cbf1b57f15531..794c8fcc50c44 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridNioServer.java @@ -104,9 +104,6 @@ public class GridNioServer { /** Default send queue limit. */ public static final int DFLT_SEND_QUEUE_LIMIT = 0; - /** Default SO_LINGER option for sockets. */ - private static final int DFLT_SO_LINGER = 5; - /** Time, which server will wait before retry operation. */ private static final long ERR_WAIT_TIME = 2000; @@ -186,9 +183,6 @@ public class GridNioServer { /** Tcp no delay flag. */ private final boolean tcpNoDelay; - /** SO_LINGER option to set for accepted sockets, set negative to disable. */ - private int soLinger = DFLT_SO_LINGER; - /** Socket send buffer. */ private final int sockSndBuf; @@ -265,7 +259,6 @@ public class GridNioServer { * falling into {@code selector.select(long)} in NIO server. Long value. Default is {@code 0}. * Can be set to {@code Long.MAX_VALUE} so selector threads will never block. * @param tcpNoDelay If TCP_NODELAY option should be set to accepted sockets. - * @param soLinger SO_LINGER option for accepted sockets. * @param directBuf Direct buffer flag. * @param order Byte order. * @param lsnr Listener. @@ -292,7 +285,6 @@ private GridNioServer( @Nullable String srvName, long selectorSpins, boolean tcpNoDelay, - int soLinger, boolean directBuf, ByteOrder order, GridNioServerListener lsnr, @@ -326,7 +318,6 @@ private GridNioServer( this.directBuf = directBuf; this.order = order; this.tcpNoDelay = tcpNoDelay; - this.soLinger = soLinger; this.sockRcvBuf = sockRcvBuf; this.sockSndBuf = sockSndBuf; this.sndQueueLimit = sndQueueLimit; @@ -3031,7 +3022,6 @@ private void processSelectedKeys(Set keys) throws IOException { sockCh.configureBlocking(false); sockCh.socket().setTcpNoDelay(tcpNoDelay); sockCh.socket().setKeepAlive(true); - sockCh.socket().setSoLinger(soLinger >= 0, soLinger); if (sockSndBuf > 0) sockCh.socket().setSendBufferSize(sockSndBuf); @@ -3634,9 +3624,6 @@ public static class Builder { /** TCP_NO_DELAY flag. */ private boolean tcpNoDelay; - /** SO_LINGER value for set fo . */ - private int soLinger = DFLT_SO_LINGER; - /** Direct buffer flag. */ private boolean directBuf; @@ -3710,7 +3697,6 @@ public GridNioServer build() throws IgniteCheckedException { srvName, selectorSpins, tcpNoDelay, - soLinger, directBuf, byteOrder, lsnr, @@ -3830,16 +3816,6 @@ public Builder tcpNoDelay(boolean tcpNoDelay) { return this; } - /** - * @param soLinger Set SO_LINGER option to accepted sockets. - * @return This for chaining. - */ - public Builder soLinger(int soLinger) { - this.soLinger = soLinger; - - return this; - } - /** * @param directBuf Whether to use direct buffer. * @return This for chaining. diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index cc57d8f0ed3f5..15bc0d5fa0430 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -359,9 +359,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati /** Default value for {@code TCP_NODELAY} socket option (value is true). */ public static final boolean DFLT_TCP_NODELAY = true; - /** Default SO_LINGER to set for socket, 0 means enabled with zero timeout. */ - public static final int DFLT_SO_LINGER = 5; - /** Default value for {@code FILTER_REACHABLE_ADDRESSES} socket option (value is false). */ public static final boolean DFLT_FILTER_REACHABLE_ADDRESSES = false; @@ -1156,9 +1153,6 @@ class ConnectClosure implements IgniteInClosure { /** {@code TCP_NODELAY} option value for created sockets. */ private boolean tcpNoDelay = DFLT_TCP_NODELAY; - /** {@code SO_LINGER} option value for created sockets. */ - private int soLinger = DFLT_SO_LINGER; - /** {@code FILTER_REACHABLE_ADDRESSES} option value for created sockets. */ private boolean filterReachableAddresses = DFLT_FILTER_REACHABLE_ADDRESSES; @@ -1764,30 +1758,6 @@ public boolean isTcpNoDelay() { return tcpNoDelay; } - /** - * Sets value for {@code SO_LINGER} socket option. Each - * socket will be opened using provided value. - *

- * Setting non-negative option to will enable SO_LINGER to close sockets in predictable timeout in seconds. - * Setting negative option will disable this. - *

- * - * @param soLinger SoLinger value to set. - */ - @IgniteSpiConfiguration(optional = true) - public void setSoLinger(int soLinger) { - this.soLinger = soLinger; - } - - /** - * Gets value for {@code SO_LINGER} socket option. - * - * @return SO_LINGER value for sockets. - */ - public int getSoLinger() { - return soLinger; - } - /** * Gets value for {@code FILTER_REACHABLE_ADDRESSES} socket option. * @@ -2245,7 +2215,6 @@ public int boundPort() { log.debug(configInfo("directSendBuf", directSndBuf)); log.debug(configInfo("selectorsCnt", selectorsCnt)); log.debug(configInfo("tcpNoDelay", tcpNoDelay)); - log.debug(configInfo("soLinger", soLinger)); log.debug(configInfo("sockSndBuf", sockSndBuf)); log.debug(configInfo("sockRcvBuf", sockRcvBuf)); log.debug(configInfo("shmemPort", shmemPort)); @@ -2467,7 +2436,6 @@ private GridNioServer resetNioServer() throws IgniteCheckedException { .igniteInstanceName(igniteInstanceName) .serverName("tcp-comm") .tcpNoDelay(tcpNoDelay) - .soLinger(soLinger) .directBuffer(directBuf) .byteOrder(ByteOrder.nativeOrder()) .socketSendBufferSize(sockSndBuf) @@ -3350,7 +3318,6 @@ protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) ch.socket().setTcpNoDelay(tcpNoDelay); ch.socket().setKeepAlive(true); - ch.socket().setSoLinger(getSoLinger() >= 0, getSoLinger()); if (sockRcvBuf > 0) ch.socket().setReceiveBufferSize(sockRcvBuf); @@ -5015,11 +4982,6 @@ private class TcpCommunicationSpiMBeanImpl extends IgniteSpiMBeanAdapter impleme return TcpCommunicationSpi.this.isTcpNoDelay(); } - /** {@inheritDoc} */ - @Override public int getSoLinger() { - return TcpCommunicationSpi.this.getSoLinger(); - } - /** {@inheritDoc} */ @Override public int getSocketReceiveBuffer() { return TcpCommunicationSpi.this.getSocketReceiveBuffer(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java index cfb8ed5751290..ca144c0c4972c 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java @@ -232,14 +232,6 @@ public interface TcpCommunicationSpiMBean extends IgniteSpiManagementMBean { @MXBeanDescription("TCP_NODELAY socket option value.") public boolean isTcpNoDelay(); - /** - * Gets value for {@code SO_LINGER} socket option. - * - * @return Negative value is SO_LINGER is disabled. - */ - @MXBeanDescription("SO_LINGER socket option value.") - public int getSoLinger(); - /** * Gets flag defining whether direct send buffer should be used. * 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 c3b704a2fd81f..e1577fb65bd83 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 @@ -6158,7 +6158,6 @@ private class SocketReader extends IgniteSpiThread { // Set socket options. sock.setKeepAlive(true); sock.setTcpNoDelay(true); - sock.setSoLinger(spi.getSoLinger() >= 0, spi.getSoLinger()); int timeout = sock.getSoTimeout(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java index c2c22b9a66122..aa23206a17f61 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java @@ -1535,6 +1535,8 @@ protected Socket openSocket(Socket sock, InetSocketAddress remAddr, IgniteSpiOpe assert addr != null; + sock.setSoTimeout((int)timeoutHelper.nextTimeoutChunk(sockTimeout)); + sock.connect(resolved, (int)timeoutHelper.nextTimeoutChunk(sockTimeout)); writeToSocket(sock, null, U.IGNITE_HEADER, timeoutHelper.nextTimeoutChunk(sockTimeout)); From b2de93f0ae7b0e71be3a2254f70a7c2c9ab60b6a Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Tue, 12 Feb 2019 14:18:16 +0300 Subject: [PATCH 07/10] Revert: IGNITE-11288 Fix parity tests. --- .../ApiParity/TcpCommunicationSpiParityTest.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs index e767e90291a07..be8bd11af6487 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs @@ -65,9 +65,7 @@ public class TcpCommunicationSpiParityTest }; /** Properties that are missing on .NET side. */ - private static readonly string[] MissingProperties = { - "soLinger" - }; + private static readonly string[] MissingProperties = {}; ///

/// Tests the cache configuration parity. From d8bbe724823116aead9049c2093f878d081b748b Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Tue, 12 Feb 2019 16:18:06 +0300 Subject: [PATCH 08/10] IGNITE-11255 Fix TC failures. --- .../org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java index aa23206a17f61..c2c22b9a66122 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java @@ -1535,8 +1535,6 @@ protected Socket openSocket(Socket sock, InetSocketAddress remAddr, IgniteSpiOpe assert addr != null; - sock.setSoTimeout((int)timeoutHelper.nextTimeoutChunk(sockTimeout)); - sock.connect(resolved, (int)timeoutHelper.nextTimeoutChunk(sockTimeout)); writeToSocket(sock, null, U.IGNITE_HEADER, timeoutHelper.nextTimeoutChunk(sockTimeout)); From 07dca7853ea7bdf82a805298df53fc1218d3ea84 Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Tue, 12 Feb 2019 21:14:20 +0300 Subject: [PATCH 09/10] TcpCommunicationSpi soLinger 5 for blocking sockets. --- .../tcp/TcpCommunicationSpi.java | 37 +++++++++++++++++++ .../tcp/TcpCommunicationSpiMBean.java | 8 ++++ .../TcpCommunicationSpiParityTest.cs | 4 +- 3 files changed, 48 insertions(+), 1 deletion(-) diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index 243f707bce7a5..9729a9ea663a8 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -359,6 +359,9 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati /** Default value for {@code TCP_NODELAY} socket option (value is true). */ public static final boolean DFLT_TCP_NODELAY = true; + /** Default SO_LINGER to set for socket, 0 means enabled with zero timeout. */ + public static final int DFLT_SO_LINGER = 5; + /** Default value for {@code FILTER_REACHABLE_ADDRESSES} socket option (value is false). */ public static final boolean DFLT_FILTER_REACHABLE_ADDRESSES = false; @@ -1153,6 +1156,9 @@ class ConnectClosure implements IgniteInClosure { /** {@code TCP_NODELAY} option value for created sockets. */ private boolean tcpNoDelay = DFLT_TCP_NODELAY; + /** {@code SO_LINGER} option value for created sockets. */ + private int soLinger = DFLT_SO_LINGER; + /** {@code FILTER_REACHABLE_ADDRESSES} option value for created sockets. */ private boolean filterReachableAddresses = DFLT_FILTER_REACHABLE_ADDRESSES; @@ -1758,6 +1764,30 @@ public boolean isTcpNoDelay() { return tcpNoDelay; } + /** + * Sets value for {@code SO_LINGER} socket option. Each + * socket will be opened using provided value. + *

+ * Setting non-negative option to will enable SO_LINGER to close sockets in predictable timeout in seconds. + * Setting negative option will disable this. + *

+ * + * @param soLinger SoLinger value to set. + */ + @IgniteSpiConfiguration(optional = true) + public void setSoLinger(int soLinger) { + this.soLinger = soLinger; + } + + /** + * Gets value for {@code SO_LINGER} socket option. + * + * @return SO_LINGER value for sockets. + */ + public int getSoLinger() { + return soLinger; + } + /** * Gets value for {@code FILTER_REACHABLE_ADDRESSES} socket option. * @@ -2215,6 +2245,7 @@ public int boundPort() { log.debug(configInfo("directSendBuf", directSndBuf)); log.debug(configInfo("selectorsCnt", selectorsCnt)); log.debug(configInfo("tcpNoDelay", tcpNoDelay)); + log.debug(configInfo("soLinger", soLinger)); log.debug(configInfo("sockSndBuf", sockSndBuf)); log.debug(configInfo("sockRcvBuf", sockRcvBuf)); log.debug(configInfo("shmemPort", shmemPort)); @@ -3321,6 +3352,7 @@ protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) ch.socket().setTcpNoDelay(tcpNoDelay); ch.socket().setKeepAlive(true); + ch.socket().setSoLinger(getSoLinger() >= 0, getSoLinger()); if (sockRcvBuf > 0) ch.socket().setReceiveBufferSize(sockRcvBuf); @@ -4985,6 +5017,11 @@ private class TcpCommunicationSpiMBeanImpl extends IgniteSpiMBeanAdapter impleme return TcpCommunicationSpi.this.isTcpNoDelay(); } + /** {@inheritDoc} */ + @Override public int getSoLinger() { + return TcpCommunicationSpi.this.getSoLinger(); + } + /** {@inheritDoc} */ @Override public int getSocketReceiveBuffer() { return TcpCommunicationSpi.this.getSocketReceiveBuffer(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java index ca144c0c4972c..cfb8ed5751290 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java @@ -232,6 +232,14 @@ public interface TcpCommunicationSpiMBean extends IgniteSpiManagementMBean { @MXBeanDescription("TCP_NODELAY socket option value.") public boolean isTcpNoDelay(); + /** + * Gets value for {@code SO_LINGER} socket option. + * + * @return Negative value is SO_LINGER is disabled. + */ + @MXBeanDescription("SO_LINGER socket option value.") + public int getSoLinger(); + /** * Gets flag defining whether direct send buffer should be used. * diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs index be8bd11af6487..e767e90291a07 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs @@ -65,7 +65,9 @@ public class TcpCommunicationSpiParityTest }; /** Properties that are missing on .NET side. */ - private static readonly string[] MissingProperties = {}; + private static readonly string[] MissingProperties = { + "soLinger" + }; ///

/// Tests the cache configuration parity. From af33772ec1c505080b0e761dc0ff213e29634d6c Mon Sep 17 00:00:00 2001 From: Pavel Voronkin Date: Tue, 12 Feb 2019 22:18:23 +0300 Subject: [PATCH 10/10] Revert "TcpCommunicationSpi soLinger 5 for blocking sockets." This reverts commit 07dca78 --- .../tcp/TcpCommunicationSpi.java | 37 ------------------- .../tcp/TcpCommunicationSpiMBean.java | 8 ---- .../TcpCommunicationSpiParityTest.cs | 4 +- 3 files changed, 1 insertion(+), 48 deletions(-) diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java index 9729a9ea663a8..243f707bce7a5 100755 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java @@ -359,9 +359,6 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati /** Default value for {@code TCP_NODELAY} socket option (value is true). */ public static final boolean DFLT_TCP_NODELAY = true; - /** Default SO_LINGER to set for socket, 0 means enabled with zero timeout. */ - public static final int DFLT_SO_LINGER = 5; - /** Default value for {@code FILTER_REACHABLE_ADDRESSES} socket option (value is false). */ public static final boolean DFLT_FILTER_REACHABLE_ADDRESSES = false; @@ -1156,9 +1153,6 @@ class ConnectClosure implements IgniteInClosure { /** {@code TCP_NODELAY} option value for created sockets. */ private boolean tcpNoDelay = DFLT_TCP_NODELAY; - /** {@code SO_LINGER} option value for created sockets. */ - private int soLinger = DFLT_SO_LINGER; - /** {@code FILTER_REACHABLE_ADDRESSES} option value for created sockets. */ private boolean filterReachableAddresses = DFLT_FILTER_REACHABLE_ADDRESSES; @@ -1764,30 +1758,6 @@ public boolean isTcpNoDelay() { return tcpNoDelay; } - /** - * Sets value for {@code SO_LINGER} socket option. Each - * socket will be opened using provided value. - *

- * Setting non-negative option to will enable SO_LINGER to close sockets in predictable timeout in seconds. - * Setting negative option will disable this. - *

- * - * @param soLinger SoLinger value to set. - */ - @IgniteSpiConfiguration(optional = true) - public void setSoLinger(int soLinger) { - this.soLinger = soLinger; - } - - /** - * Gets value for {@code SO_LINGER} socket option. - * - * @return SO_LINGER value for sockets. - */ - public int getSoLinger() { - return soLinger; - } - /** * Gets value for {@code FILTER_REACHABLE_ADDRESSES} socket option. * @@ -2245,7 +2215,6 @@ public int boundPort() { log.debug(configInfo("directSendBuf", directSndBuf)); log.debug(configInfo("selectorsCnt", selectorsCnt)); log.debug(configInfo("tcpNoDelay", tcpNoDelay)); - log.debug(configInfo("soLinger", soLinger)); log.debug(configInfo("sockSndBuf", sockSndBuf)); log.debug(configInfo("sockRcvBuf", sockRcvBuf)); log.debug(configInfo("shmemPort", shmemPort)); @@ -3352,7 +3321,6 @@ protected GridCommunicationClient createTcpClient(ClusterNode node, int connIdx) ch.socket().setTcpNoDelay(tcpNoDelay); ch.socket().setKeepAlive(true); - ch.socket().setSoLinger(getSoLinger() >= 0, getSoLinger()); if (sockRcvBuf > 0) ch.socket().setReceiveBufferSize(sockRcvBuf); @@ -5017,11 +4985,6 @@ private class TcpCommunicationSpiMBeanImpl extends IgniteSpiMBeanAdapter impleme return TcpCommunicationSpi.this.isTcpNoDelay(); } - /** {@inheritDoc} */ - @Override public int getSoLinger() { - return TcpCommunicationSpi.this.getSoLinger(); - } - /** {@inheritDoc} */ @Override public int getSocketReceiveBuffer() { return TcpCommunicationSpi.this.getSocketReceiveBuffer(); diff --git a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java index cfb8ed5751290..ca144c0c4972c 100644 --- a/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java +++ b/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpiMBean.java @@ -232,14 +232,6 @@ public interface TcpCommunicationSpiMBean extends IgniteSpiManagementMBean { @MXBeanDescription("TCP_NODELAY socket option value.") public boolean isTcpNoDelay(); - /** - * Gets value for {@code SO_LINGER} socket option. - * - * @return Negative value is SO_LINGER is disabled. - */ - @MXBeanDescription("SO_LINGER socket option value.") - public int getSoLinger(); - /** * Gets flag defining whether direct send buffer should be used. * diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs index e767e90291a07..be8bd11af6487 100644 --- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs +++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/ApiParity/TcpCommunicationSpiParityTest.cs @@ -65,9 +65,7 @@ public class TcpCommunicationSpiParityTest }; /** Properties that are missing on .NET side. */ - private static readonly string[] MissingProperties = { - "soLinger" - }; + private static readonly string[] MissingProperties = {}; ///

/// Tests the cache configuration parity.