From a9ee73b0694ad9b8efa10a8b22a6d1deb93586f8 Mon Sep 17 00:00:00 2001 From: Tigran Mkrtchyan Date: Thu, 15 Aug 2024 11:08:11 +0200 Subject: [PATCH] drv: use dedicated thread pool for notifications and callbacks --- src/main/java/org/dcache/nearline/cta/CtaNearlineStorage.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/dcache/nearline/cta/CtaNearlineStorage.java b/src/main/java/org/dcache/nearline/cta/CtaNearlineStorage.java index db13995..f2e4dc2 100644 --- a/src/main/java/org/dcache/nearline/cta/CtaNearlineStorage.java +++ b/src/main/java/org/dcache/nearline/cta/CtaNearlineStorage.java @@ -33,6 +33,7 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ExecutionException; import ch.cern.cta.rpc.CtaRpcGrpc.CtaRpcBlockingStub; +import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; import org.dcache.namespace.FileAttribute; import org.dcache.nearline.cta.xrootd.DataMover; @@ -480,7 +481,8 @@ public void start() { .channelType(NioSocketChannel.class) // use Nio event loop instead of epoll .eventLoopGroup(new NioEventLoopGroup(0, new ThreadFactoryBuilder().setNameFormat("cta-grpc-worker-%d").build())) - .directExecutor() // use netty threads + .executor(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()*2, + new ThreadFactoryBuilder().setNameFormat("cta-grpc-callback-runner-%d").build())) .build(); cta = CtaRpcGrpc.newBlockingStub(channel);