diff --git a/src/main/groovy/io/seqera/wave/filter/PullMetricsRequestsFilter.groovy b/src/main/groovy/io/seqera/wave/filter/PullMetricsRequestsFilter.groovy index bb70548ac..07fc817e0 100644 --- a/src/main/groovy/io/seqera/wave/filter/PullMetricsRequestsFilter.groovy +++ b/src/main/groovy/io/seqera/wave/filter/PullMetricsRequestsFilter.groovy @@ -68,7 +68,7 @@ class PullMetricsRequestsFilter implements HttpServerFilter { private RouteHandler routeHelper @Inject - @Named(TaskExecutors.IO) + @Named(TaskExecutors.BLOCKING) private ExecutorService executor @Override diff --git a/src/main/groovy/io/seqera/wave/http/HttpClientFactory.groovy b/src/main/groovy/io/seqera/wave/http/HttpClientFactory.groovy index 46c9730d2..f0852219f 100644 --- a/src/main/groovy/io/seqera/wave/http/HttpClientFactory.groovy +++ b/src/main/groovy/io/seqera/wave/http/HttpClientFactory.groovy @@ -20,13 +20,12 @@ package io.seqera.wave.http import java.net.http.HttpClient import java.time.Duration -import java.util.concurrent.ExecutorService import java.util.concurrent.Executors +import java.util.concurrent.ThreadFactory import java.util.concurrent.locks.ReentrantLock import groovy.transform.CompileStatic import groovy.util.logging.Slf4j -import io.seqera.wave.util.CustomThreadFactory /** * Java HttpClient factory * @@ -36,7 +35,9 @@ import io.seqera.wave.util.CustomThreadFactory @CompileStatic class HttpClientFactory { - static private ExecutorService threadPool = Executors.newCachedThreadPool(new CustomThreadFactory("HttpClientThread")) + static final private ThreadFactory customThreadFactory = Thread.ofVirtual() + .name("httpclient-virtual-thread-", 1) + .factory(); static private Duration timeout = Duration.ofSeconds(20) @@ -84,7 +85,7 @@ class HttpClientFactory { .version(HttpClient.Version.HTTP_1_1) .followRedirects(HttpClient.Redirect.NORMAL) .connectTimeout(timeout) - .executor(threadPool) + .executor(Executors.newThreadPerTaskExecutor(customThreadFactory)) .build() log.debug "Creating new followRedirectsHttpClient: $result" return result @@ -95,7 +96,7 @@ class HttpClientFactory { .version(HttpClient.Version.HTTP_1_1) .followRedirects(HttpClient.Redirect.NEVER) .connectTimeout(timeout) - .executor(threadPool) + .executor(Executors.newThreadPerTaskExecutor(customThreadFactory)) .build() log.debug "Creating new neverRedirectsHttpClient: $result" return result diff --git a/src/main/groovy/io/seqera/wave/service/builder/impl/BuildStateStoreImpl.groovy b/src/main/groovy/io/seqera/wave/service/builder/impl/BuildStateStoreImpl.groovy index d9562ce43..963629aaa 100644 --- a/src/main/groovy/io/seqera/wave/service/builder/impl/BuildStateStoreImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/builder/impl/BuildStateStoreImpl.groovy @@ -50,7 +50,7 @@ class BuildStateStoreImpl extends AbstractStateStore implements Buil private ExecutorService ioExecutor - BuildStateStoreImpl(StateProvider provider, BuildConfig buildConfig, @Named(TaskExecutors.IO) ExecutorService ioExecutor) { + BuildStateStoreImpl(StateProvider provider, BuildConfig buildConfig, @Named(TaskExecutors.BLOCKING) ExecutorService ioExecutor) { super(provider, new MoshiEncodeStrategy() {}) this.buildConfig = buildConfig this.ioExecutor = ioExecutor diff --git a/src/main/groovy/io/seqera/wave/service/builder/impl/ContainerBuildServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/builder/impl/ContainerBuildServiceImpl.groovy index 895a90210..43cf41d72 100644 --- a/src/main/groovy/io/seqera/wave/service/builder/impl/ContainerBuildServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/builder/impl/ContainerBuildServiceImpl.groovy @@ -87,7 +87,7 @@ class ContainerBuildServiceImpl implements ContainerBuildService, JobHandler implements FutureStore { private volatile Duration pollInterval @Inject - @Named('future-store-executor') + @Named(TaskExecutors.BLOCKING) private ExecutorService executor AbstractFutureStore(FutureHash store, EncodingStrategy encodingStrategy) { diff --git a/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy index 8be138dd1..2852dbadd 100644 --- a/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/logs/BuildLogServiceImpl.groovy @@ -79,7 +79,7 @@ class BuildLogServiceImpl implements BuildLogService { private String condaLockPrefix @Inject - @Named(TaskExecutors.IO) + @Named(TaskExecutors.BLOCKING) private volatile ExecutorService ioExecutor @PostConstruct diff --git a/src/main/groovy/io/seqera/wave/service/mirror/ContainerMirrorServiceImpl.groovy b/src/main/groovy/io/seqera/wave/service/mirror/ContainerMirrorServiceImpl.groovy index 1126fe87d..ff4c71938 100644 --- a/src/main/groovy/io/seqera/wave/service/mirror/ContainerMirrorServiceImpl.groovy +++ b/src/main/groovy/io/seqera/wave/service/mirror/ContainerMirrorServiceImpl.groovy @@ -54,7 +54,7 @@ class ContainerMirrorServiceImpl implements ContainerMirrorService, JobHandler