Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NPE thrown by the ComputeProcessor due to a null SourceTable.table #242

Closed
NassimBtk opened this issue Jun 8, 2024 · 0 comments · Fixed by #244
Closed

NPE thrown by the ComputeProcessor due to a null SourceTable.table #242

NassimBtk opened this issue Jun 8, 2024 · 0 comments · Fixed by #244
Assignees
Labels
bug Something isn't working

Comments

@NassimBtk
Copy link
Member

NassimBtk commented Jun 8, 2024

Problem:

C:\Program Files\MetricsHub>MetricsHubServiceManager.exe
Listening for transport dt_socket at address: 5005
Exception in thread "pool-85727-thread-2" java.lang.NullPointerException: Cannot invoke "java.util.List.iterator()" because the return value of "org.sentrysoftware.metricshub.engine.strategy.source.SourceTable.getTable()" is null
        at org.sentrysoftware.metricshub.engine.strategy.source.compute.ComputeProcessor.process(ComputeProcessor.java:595)
        at org.sentrysoftware.metricshub.engine.connector.model.monitor.task.source.compute.DuplicateColumn.accept(DuplicateColumn.java:96)
        at org.sentrysoftware.metricshub.engine.strategy.source.compute.ComputeUpdaterProcessor.processCompute(ComputeUpdaterProcessor.java:201)
        at org.sentrysoftware.metricshub.engine.strategy.source.compute.ComputeUpdaterProcessor.process(ComputeUpdaterProcessor.java:106)
        at org.sentrysoftware.metricshub.engine.connector.model.monitor.task.source.compute.DuplicateColumn.accept(DuplicateColumn.java:96)
        at org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy.processSourcesAndComputes(AbstractStrategy.java:203)
        at org.sentrysoftware.metricshub.engine.strategy.AbstractStrategy.processSourcesAndComputes(AbstractStrategy.java:99)
        at org.sentrysoftware.metricshub.engine.strategy.collect.CollectStrategy.processMonitorJob(CollectStrategy.java:243)
        at org.sentrysoftware.metricshub.engine.strategy.collect.CollectStrategy.lambda$collect$8(CollectStrategy.java:183)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.base/java.lang.Thread.run(Unknown Source)
        

This has been observed on other computes not only the DuplicateColumn.

Proposal:

Check the source processor that generates the null table otherwise it probably comes from a client library returning a null List<List<String>>.

Also, form the AbstractStrategy, skip the compute processing if sourcetable.table and sourcetable.rawRest are both null.

@NassimBtk NassimBtk added the bug Something isn't working label Jun 8, 2024
@TNohaic TNohaic changed the title NPE thrown by the ComputeProcessor du to a null SourceTable.table NPE thrown by the ComputeProcessor due to a null SourceTable.table Jun 10, 2024
TNohaic added a commit that referenced this issue Jun 10, 2024
…ble.table

Add a test to check if the source table is empty before starting the computes.
NassimBtk added a commit that referenced this issue Jun 10, 2024
…own-by-the-computeprocessor-du-to-a-null-sourcetabletable

Issue #242:  NPE thrown by the ComputeProcessor due to a null SourceTable.table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants