From 64b2320eb2b156573423e7d5f0ebc85bc232a410 Mon Sep 17 00:00:00 2001 From: Andrew Azores Date: Thu, 24 Oct 2024 16:46:05 -0400 Subject: [PATCH] use infrastructure pool instead of forkjoin --- src/main/java/io/cryostat/targets/TargetUpdateJob.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/cryostat/targets/TargetUpdateJob.java b/src/main/java/io/cryostat/targets/TargetUpdateJob.java index cda6e64f1..7a67cd15a 100644 --- a/src/main/java/io/cryostat/targets/TargetUpdateJob.java +++ b/src/main/java/io/cryostat/targets/TargetUpdateJob.java @@ -17,8 +17,6 @@ import java.time.Duration; import java.util.List; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.ForkJoinPool; import io.cryostat.ConfigProperties; import io.cryostat.core.net.JFRConnection; @@ -26,6 +24,7 @@ import io.cryostat.recordings.RecordingHelper; import io.quarkus.narayana.jta.QuarkusTransaction; +import io.smallrye.mutiny.infrastructure.Infrastructure; import jakarta.inject.Inject; import jakarta.transaction.Transactional; import org.eclipse.microprofile.config.inject.ConfigProperty; @@ -39,7 +38,6 @@ public class TargetUpdateJob implements Job { @Inject Logger logger; @Inject TargetConnectionManager connectionManager; @Inject RecordingHelper recordingHelper; - ExecutorService executor = ForkJoinPool.commonPool(); @ConfigProperty(name = ConfigProperties.CONNECTIONS_FAILED_TIMEOUT) Duration connectionTimeout; @@ -58,7 +56,8 @@ public void execute(JobExecutionContext context) throws JobExecutionException { if (targets.size() == 1) { updateTarget(targets.get(0)); } else { - targets.forEach(t -> executor.submit(() -> updateTargetTx(t.id))); + targets.forEach( + t -> Infrastructure.getDefaultExecutor().execute(() -> updateTargetTx(t.id))); } }