From 5a9bc6070aafda16861cd0e44d4a677e0767c44c Mon Sep 17 00:00:00 2001 From: Kirill Tkalenko Date: Tue, 21 Apr 2026 08:43:35 +0300 Subject: [PATCH] IGNITE-28584 wip --- ...oManyOpenFilesTcpCommunicationSpiTest.java | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TooManyOpenFilesTcpCommunicationSpiTest.java b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TooManyOpenFilesTcpCommunicationSpiTest.java index f4165a71e7080..9ab03d4012008 100644 --- a/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TooManyOpenFilesTcpCommunicationSpiTest.java +++ b/modules/core/src/test/java/org/apache/ignite/spi/communication/tcp/TooManyOpenFilesTcpCommunicationSpiTest.java @@ -18,6 +18,7 @@ package org.apache.ignite.spi.communication.tcp; import java.net.SocketException; +import java.util.UUID; import org.apache.ignite.IgniteCache; import org.apache.ignite.cluster.ClusterState; import org.apache.ignite.cluster.ClusterTopologyException; @@ -102,7 +103,9 @@ public void testTooManyOpenFilesErr() throws Exception { nioSrvWrapper.socketChannelFactory(() -> { throw new SocketException("Too many open files"); }); - connPool.forceCloseConnection(txNode.localNode().id()); + // Sometimes we can get `org.apache.ignite.IgniteCheckedException: Too many open files` due to parallel + // connection creation, since the forceCloseConnection is for tests, then we can ignore the exception. + forceCloseConnectionSafe(connPool, txNode.localNode().id()); cache.put(1, 2); cache.put(2, 3); @@ -117,4 +120,20 @@ public void testTooManyOpenFilesErr() throws Exception { assertTrue(waitForCondition(((IgniteKernal)stopNode)::isStopping, 60_000)); } + + /** */ + private static void forceCloseConnectionSafe(ConnectionClientPool connPool, UUID nodeId) throws Exception { + assertTrue(waitForCondition(() -> { + try { + connPool.forceCloseConnection(nodeId); + + return true; + } + catch (Throwable t) { + log.error("Error occurred while attempting to force close connections for node: " + nodeId, t); + + return false; + } + }, 10_000)); + } }