Skip to content

Commit e67efac

Browse files
committed
chore: add more diagnostic information
1 parent f67aad6 commit e67efac

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/api/config/ExecutorServiceManager.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public static void init(ConfigurationService configuration) {
3131
instance = new ExecutorServiceManager(
3232
new InstrumentedExecutorService(configuration.getExecutorService()),
3333
configuration.getTerminationTimeoutSeconds());
34+
log.debug("Initialized ExecutorServiceManager executor: {}, timeout: {}",
35+
configuration.getExecutorService().getClass(),
36+
configuration.getTerminationTimeoutSeconds());
3437
} else {
3538
log.debug("Already started, reusing already setup instance!");
3639
}
@@ -47,6 +50,7 @@ public static void stop() {
4750

4851
public static void useTestInstance() {
4952
if (instance == null) {
53+
log.debug("Using test instance");
5054
instance = new ExecutorServiceManager(
5155
new InstrumentedExecutorService(Executors.newFixedThreadPool(5)), 1);
5256
}
@@ -55,7 +59,7 @@ public static void useTestInstance() {
5559
public static ExecutorServiceManager instance() {
5660
if (instance == null) {
5761
throw new IllegalStateException(
58-
"ExecutorServiceManager hasn't been started. Call start method before using!");
62+
"ExecutorServiceManager hasn't been started. Call init method before using!");
5963
}
6064
return instance;
6165
}
@@ -81,6 +85,9 @@ private static class InstrumentedExecutorService implements ExecutorService {
8185
private final ExecutorService executor;
8286

8387
private InstrumentedExecutorService(ExecutorService executor) {
88+
if (executor == null) {
89+
throw new NullPointerException();
90+
}
8491
this.executor = executor;
8592
debug = Utils.debugThreadPool();
8693
}

operator-framework-core/src/main/java/io/javaoperatorsdk/operator/processing/Controller.java

+2
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,8 @@ public void start() throws OperatorException {
259259
final String controllerName = configuration.getName();
260260
final var crdName = configuration.getResourceTypeName();
261261
final var specVersion = "v1";
262+
log.info("Starting '{}' controller for reconciler: {}, resource: {}", controllerName,
263+
reconciler.getClass().getCanonicalName(), resClass.getCanonicalName());
262264
final var configurationService = configuration.getConfigurationService();
263265
try {
264266
// check that the custom resource is known by the cluster if configured that way

0 commit comments

Comments
 (0)