From 26a11bccc9418e6e997094a87c689b511d71794d Mon Sep 17 00:00:00 2001 From: Andrzej Cichocki Date: Thu, 1 Mar 2018 17:35:41 +0000 Subject: [PATCH] CORDA-1004 Use FastThreadLocalThread in multi-thread SMM. (#492) --- .../src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt b/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt index 1195c3ae3a..2a4892e53d 100644 --- a/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt +++ b/node/src/main/kotlin/net/corda/node/internal/EnterpriseNode.kt @@ -7,6 +7,7 @@ import com.codahale.metrics.graphite.PickledGraphite import com.google.common.util.concurrent.ThreadFactoryBuilder import com.jcraft.jsch.JSch import com.jcraft.jsch.JSchException +import io.netty.util.concurrent.FastThreadLocalThread import net.corda.core.crypto.newSecureRandom import net.corda.core.identity.CordaX500Name import net.corda.core.internal.Emoji @@ -23,7 +24,6 @@ import org.fusesource.jansi.Ansi import org.fusesource.jansi.AnsiConsole import java.io.IOException import java.net.Inet6Address -import java.net.InetAddress import java.util.concurrent.ExecutorService import java.util.concurrent.Executors import java.util.concurrent.TimeUnit @@ -166,7 +166,7 @@ D""".trimStart() private fun makeStateMachineExecutorService(): ExecutorService { return Executors.newFixedThreadPool( configuration.enterpriseConfiguration.tuning.flowThreadPoolSize, - ThreadFactoryBuilder().setNameFormat("flow-executor-%d").build() + ThreadFactoryBuilder().setNameFormat("flow-executor-%d").setThreadFactory(::FastThreadLocalThread).build() ) }