Skip to content

NullPointerException can occur when receiving a message with unknown Knowledge Interaction Id #480

@bnouwt

Description

@bnouwt

In distributive setup, restarting a KER might cause other KERs to send responses to messages that were send before the restart. These Messages contain knowledge interaction IDs that are no longer availble/known. This causes the following error:

2024-02-16 12:46:13:407 +0000 [pool-6-thread-1] ERROR LocalSmartConnectorConnection - Error occured while processing message by Smart Connector.
java.lang.NullPointerException: Cannot invoke "eu.knowledge.engine.smartconnector.impl.KnowledgeInteractionInfo.getKnowledgeInteraction()" because "knowledgeInteractionById" is null
   at eu.knowledge.engine.smartconnector.impl.InteractionProcessorImpl.processPostFromMessageRouter(InteractionProcessorImpl.java:309)
   at eu.knowledge.engine.smartconnector.impl.MessageRouterImpl.handlePostMessage(MessageRouterImpl.java:178)
   at eu.knowledge.engine.smartconnector.runtime.messaging.LocalSmartConnectorConnection.lambda$deliverToLocalSmartConnector$0(LocalSmartConnectorConnection.java:48)
   at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
   at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
   at java.base/java.lang.Thread.run(Thread.java:1583)

At least deal with this error locally correctly (i.e. make sure the Future gets completed exceptionally) and maybe also think about the broader issue at hand (sending responses to older messages) and whether we can/want to do something about that.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions