Repository: ignite Updated Branches: refs/heads/master 64b19a99a -> 34c059a15
IGNITE-12364 Reworked Sending Full Message logging - Fixes #5413. Signed-off-by: Alexey Goncharuk <alexey.goncha...@gmail.com> Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/34c059a1 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/34c059a1 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/34c059a1 Branch: refs/heads/master Commit: 34c059a15b3505c8937045b2b973874286bc148a Parents: 64b19a9 Author: Pavel Voronkin <pvoron...@gridgain.com> Authored: Fri Nov 16 18:56:28 2018 +0300 Committer: Alexey Goncharuk <alexey.goncha...@gmail.com> Committed: Fri Nov 16 18:59:31 2018 +0300 ---------------------------------------------------------------------- .../preloader/GridDhtPartitionsExchangeFuture.java | 10 ---------- .../spi/communication/tcp/TcpCommunicationSpi.java | 15 +++++++++++++-- 2 files changed, 13 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/34c059a1/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java index c8471c7..f762d3d 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/distributed/dht/preloader/GridDhtPartitionsExchangeFuture.java @@ -1910,8 +1910,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte .map(singleMessage -> fullMsg.copy().joinedNodeAffinity(affinityForJoinedNodes)) .orElse(null); - long time = System.currentTimeMillis(); - // Prepare and send full messages for given nodes. nodes.stream() .map(node -> { @@ -1964,9 +1962,6 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte U.error(log, "Failed to send partitions [node=" + node + ']', e); } }); - - if (log.isInfoEnabled()) - log.info("Sending Full Message performed in " + (System.currentTimeMillis() - time) + " ms."); } /** @@ -3377,16 +3372,11 @@ public class GridDhtPartitionsExchangeFuture extends GridDhtTopologyFutureAdapte nodes.addAll(sndResNodes); } - time = System.currentTimeMillis(); - if (!nodes.isEmpty()) sendAllPartitions(msg, nodes, mergedJoinExchMsgs0, joinedNodeAff); partitionsSent = true; - if (log.isInfoEnabled()) - log.info("Sending Full Message to all nodes performed in " + (System.currentTimeMillis() - time) + " ms."); - if (!stateChangeExchange()) onDone(exchCtx.events().topologyVersion(), null); http://git-wip-us.apache.org/repos/asf/ignite/blob/34c059a1/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/TcpCommunicationSpi.java ---------------------------------------------------------------------- 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 427db08..3e3f7f9 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 @@ -269,6 +269,9 @@ import static org.apache.ignite.spi.communication.tcp.messages.RecoveryLastRecei @IgniteSpiMultipleInstancesSupport(true) @IgniteSpiConsistencyChecked(optional = false) public class TcpCommunicationSpi extends IgniteSpiAdapter implements CommunicationSpi<Message> { + /** Time threshold to log too long connection establish. */ + private static final int CONNECTION_ESTABLISH_THRESHOLD_MS = 100; + /** IPC error message. */ public static final String OUT_OF_RESOURCES_TCP_MSG = "Failed to allocate shared memory segment " + "(switching to TCP, may be slower)."; @@ -2983,10 +2986,18 @@ public class TcpCommunicationSpi extends IgniteSpiAdapter implements Communicati connectGate.enter(); try { + final long start = System.currentTimeMillis(); + GridCommunicationClient client = createTcpClient(node, connIdx); - if (log.isDebugEnabled()) - log.debug("TCP client created: " + client); + final long time = System.currentTimeMillis() - start; + + if (time > CONNECTION_ESTABLISH_THRESHOLD_MS) { + if (log.isInfoEnabled()) + log.info("TCP client created [client=" + client + ", duration=" + time + "ms]"); + } + else if (log.isDebugEnabled()) + log.debug("TCP client created [client=" + client + ", duration=" + time + "ms]"); return client; }