Skip to content

Commit

Permalink
fix(threads): back out cryostatio#1388 Vertexecutor where not strictl…
Browse files Browse the repository at this point in the history
…y required

Signed-off-by: Andrew Azores <aazores@redhat.com>
  • Loading branch information
andrewazores committed Apr 19, 2023
1 parent c80a81f commit 4bbcfa6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
import io.cryostat.core.sys.Environment;
import io.cryostat.core.sys.FileSystem;
import io.cryostat.net.AuthManager;
import io.cryostat.net.web.WebModule;
import io.cryostat.util.resource.ClassPropertiesLoader;

import com.github.benmanes.caffeine.cache.Scheduler;
Expand Down Expand Up @@ -123,7 +122,7 @@ static OpenShiftClient provideServiceAccountClient(
@Singleton
static OpenShiftAuthManager provideOpenShiftAuthManager(
Environment env,
@Named(WebModule.VERTX_EXECUTOR) ExecutorService executor,
ExecutorService executor,
@Named(OPENSHIFT_NAMESPACE) Lazy<String> namespace,
Lazy<OpenShiftClient> serviceAccountClient,
@Named(TOKENED_CLIENT) Function<String, OpenShiftClient> clientProvider,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/io/cryostat/net/web/Vertexecutor.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package io.cryostat.net.web;
/*
* Copyright The Cryostat Authors
*
Expand Down Expand Up @@ -37,6 +36,8 @@
* SOFTWARE.
*/

package io.cryostat.net.web;

import java.util.List;
import java.util.concurrent.AbstractExecutorService;
import java.util.concurrent.TimeUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
import java.util.Set;
import java.util.concurrent.ExecutorService;

import javax.inject.Named;

import io.cryostat.core.log.Logger;
import io.cryostat.core.net.JFRConnectionToolkit;
import io.cryostat.core.net.discovery.JvmDiscoveryClient;
Expand All @@ -50,7 +48,6 @@
import io.cryostat.net.NetworkResolver;
import io.cryostat.net.NoopAuthManager;
import io.cryostat.net.openshift.OpenShiftAuthManager;
import io.cryostat.net.web.WebModule;

import com.google.gson.Gson;
import dagger.Lazy;
Expand All @@ -69,7 +66,7 @@ static Set<PlatformDetectionStrategy<?>> providePlatformDetectionStrategies(
Lazy<OpenShiftAuthManager> openShiftAuthManager,
Lazy<NoopAuthManager> noopAuthManager,
Lazy<JFRConnectionToolkit> connectionToolkit,
@Named(WebModule.VERTX_EXECUTOR) ExecutorService executor,
ExecutorService executor,
Vertx vertx,
Gson gson,
NetworkResolver resolver,
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/io/cryostat/recordings/RecordingsModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static RecordingMetadataManager provideRecordingMetadataManager(
// CONFIGURATION_PATH
@Named(ConfigurationModule.CONFIGURATION_PATH) Path confDir,
@Named(MainModule.RECORDINGS_PATH) Path archivedRecordingsPath,
@Named(WebModule.VERTX_EXECUTOR) ExecutorService executor,
ExecutorService executor,
@Named(Variables.JMX_CONNECTION_TIMEOUT) long connectionTimeoutSeconds,
FileSystem fs,
Provider<RecordingArchiveHelper> archiveHelperProvider,
Expand Down Expand Up @@ -223,7 +223,7 @@ static RecordingMetadataManager provideRecordingMetadataManager(
@Singleton
static JvmIdHelper provideJvmIdHelper(
TargetConnectionManager targetConnectionManager,
@Named(WebModule.VERTX_EXECUTOR) ExecutorService executor,
ExecutorService executor,
@Named(Variables.JMX_CONNECTION_TIMEOUT) long connectionTimeoutSeconds,
CredentialsManager credentialsManager,
DiscoveryStorage storage,
Expand Down
9 changes: 9 additions & 0 deletions src/main/java/io/cryostat/sys/SystemModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
*/
package io.cryostat.sys;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

import javax.inject.Singleton;

import io.cryostat.core.sys.Clock;
Expand Down Expand Up @@ -65,4 +68,10 @@ static Environment provideEnvironment() {
static FileSystem provideFileSystem() {
return new FileSystem();
}

@Provides
@Singleton
static ExecutorService provideExecutorService() {
return ForkJoinPool.commonPool();
}
}

0 comments on commit 4bbcfa6

Please sign in to comment.