View Issue Details

IDProjectCategoryView StatusLast Update
0006076SymmetricDSBugpublic2023-11-01 13:00
Reporteremiller Assigned Toemiller  
Prioritynormal 
Status closedResolutionfixed 
Product Version3.14.10 
Target Version3.14.11Fixed in Version3.14.11 
Summary0006076: Protect against exceptions in CPU monitor
DescriptionIt's possible for the CPU monitor to encounter a NullPointerException or an IndexOutOfBoundsException if the command to get the CPU usage doesn't behave as expected. It would be better to fall back to the old method of obtaining CPU usage than to throw an exception.

Also, for Windows, the full path to powershell.exe should be specified to prevent the following errors:

2023-11-01 10:36:09 [INFO ] [java ] Cannot run program "powershell": CreateProcess error=2, The system cannot find the file specified
2023-11-01 10:36:09 [INFO ] [java ] java.io.IOException: Cannot run program "powershell": CreateProcess error=2, The system cannot find the file specified
2023-11-01 10:36:09 [INFO ] [java ] at java.lang.ProcessBuilder.start(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.monitor.MonitorTypeCpu.runCommand(MonitorTypeCpu.java:149)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.monitor.MonitorTypeCpu.getCpuUsage(MonitorTypeCpu.java:78)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.monitor.MonitorTypeCpu.check(MonitorTypeCpu.java:67)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.service.impl.MonitorService.updateMonitor(MonitorService.java:187)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.service.impl.MonitorService.update(MonitorService.java:121)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.job.MonitorJob.doJob(MonitorJob.java:44)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:200)
2023-11-01 10:36:09 [INFO ] [java ] at org.jumpmind.symmetric.job.AbstractJob.run(AbstractJob.java:266)
2023-11-01 10:36:09 [INFO ] [java ] at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
2023-11-01 10:36:09 [INFO ] [java ] at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.lang.Thread.run(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
2023-11-01 10:36:09 [INFO ] [java ] at java.lang.ProcessImpl.create(Native Method)
2023-11-01 10:36:09 [INFO ] [java ] at java.lang.ProcessImpl.<init>(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] at java.lang.ProcessImpl.start(Unknown Source)
2023-11-01 10:36:09 [INFO ] [java ] ... 17 more

2023-11-01 10:24:34,104 ERROR [server] [MonitorJob] [server-job-5] Exception while executing job 'Monitor' StackTraceKey.init [NullPointerException:2882032157] java.lang.NullPointerException
    at org.jumpmind.symmetric.monitor.MonitorTypeCpu.getCpuUsage(MonitorTypeCpu.java:81)
    at org.jumpmind.symmetric.monitor.MonitorTypeCpu.check(MonitorTypeCpu.java:67)
    at org.jumpmind.symmetric.service.impl.MonitorService.updateMonitor(MonitorService.java:187)
    at org.jumpmind.symmetric.service.impl.MonitorService.update(MonitorService.java:121)
    at org.jumpmind.symmetric.job.MonitorJob.doJob(MonitorJob.java:44)
    at org.jumpmind.symmetric.job.AbstractJob.invoke(AbstractJob.java:200)
    at org.jumpmind.symmetric.job.AbstractJob.run(AbstractJob.java:266)
    at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Tagsmonitoring

Relationships

related to 0006077 closedemiller SymmetricDS Pro Protect against exceptions in CPU monitor 

Activities

There are no notes attached to this issue.

Related Changesets

SymmetricDS: 3.14 b4c4fe52

2023-11-01 12:52:52

evan-miller-jumpmind

Details Diff
0006076: Protected against exceptions in CPU monitor Affected Issues
0006076
mod - symmetric-core/src/main/java/org/jumpmind/symmetric/monitor/MonitorTypeCpu.java Diff File

Issue History

Date Modified Username Field Change
2023-11-01 12:38 emiller New Issue
2023-11-01 12:38 emiller Status new => assigned
2023-11-01 12:38 emiller Assigned To => emiller
2023-11-01 12:38 emiller Tag Attached: monitoring
2023-11-01 12:39 emiller Relationship added related to 0006077
2023-11-01 12:53 emiller Status assigned => resolved
2023-11-01 12:53 emiller Resolution open => fixed
2023-11-01 12:53 emiller Fixed in Version => 3.14.11
2023-11-01 13:00 Changeset attached => SymmetricDS 3.14 b4c4fe52
2023-12-16 01:56 admin Status resolved => closed