Installed the 1.0.6 version of the DX-Gateway and enabled the RESTmon component. Everything starts fine but when I add a profile to RESTmon it fails to start the schedule. I have tried this with a number of different OOTB profiles and they all fail. This is not an issue with the endpoint as I cannot see any attempt to contact the endpoint from RESTMon,
Attached the RESTmon logs a copy of the restmon.json file.
Release : 20.2
Component : CA DOI Foundations
From Engineering:
Looked bit more into this Exception in the log:
[MetricCollector|alanelasticsearch~~elasticsearch|1|1613132672615] ERROR TaskUtils\$LoggingErrorHandler:96 - Unexpected error occurred in scheduled task.
java.lang.ExceptionInInitializerError: null
at com.ca.ce.restmon.app.core.MetricCollector.run(MetricCollector.java:84)
at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
at java.base/java.util.concurrent.Executors\$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor\$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor\$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.IllegalArgumentException: null
at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1293)
at java.base/java.util.concurrent.ThreadPoolExecutor.<init>(ThreadPoolExecutor.java:1215)
at java.base/java.util.concurrent.Executors.newFixedThreadPool(Executors.java:155)
at com.ca.ce.restmon.core.ProfileHandler.<clinit>(ProfileHandler.java:106)
... 8 common frames omitted
Engineering downloaded the binary and decompiled the code, and think they found the place:
private static final int NO_CORES_AVAILABLE = Runtime.getRuntime().availableProcessors();
private static final ExecutorService STREAM_BATCH_PROCESS_EXECUTOR = Executors.newFixedThreadPool(NO_CORES_AVAILABLE - 1, (new BasicThreadFactory.Builder());
Basically we were trying to create a thread pool with size of (# of cores - 1). So if the # of cores is less than 2, then it will fail. Possibly the customer's environment has only 1 core or for some reason the JVM API told us so.
Changing the core count fixed the issue