Skip to content

A TimeoutException should be correctly handled by the ReasonerProcessor  #531

@bnouwt

Description

@bnouwt

In version 1.2.5 with the reasoner enabled, when a TimeoutException (related to the KE_KB_WAIT_TIMEOUT env variable) occurs, the asking KB is not informed (I think) but the KI process just crashes with the following exception:

asking-sc-1      | 2024-08-27 09:04:39:366 +0000 [CompletableFutureDelayScheduler] ERROR ReasonerProcessor - A problem occurred while handling a bindingset.
asking-sc-1      | java.util.concurrent.TimeoutException
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture$Timeout.run(CompletableFuture.java:2920)
asking-sc-1      |      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
asking-sc-1      |      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
asking-sc-1      |      at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
asking-sc-1      |      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
asking-sc-1      |      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
asking-sc-1      |      at java.base/java.lang.Thread.run(Thread.java:1583)
asking-sc-1      | 2024-08-27 09:04:39:370 +0000 [CompletableFutureDelayScheduler] ERROR ReasonerProcessor - Executing (scheduled) tasks for the reasoner should not result in problems.
asking-sc-1      | java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "eu.knowledge.engine.smartconnector.messaging.AnswerMessage.getFromKnowledgeInteraction()" because "answerMessage" is null
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:649)
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(CompletableFuture.java:2194)
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture$Timeout.run(CompletableFuture.java:2920)
asking-sc-1      |      at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
asking-sc-1      |      at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
asking-sc-1      |      at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
asking-sc-1      |      at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
asking-sc-1      |      at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
asking-sc-1      |      at java.base/java.lang.Thread.run(Thread.java:1583)
asking-sc-1      | Caused by: java.lang.NullPointerException: Cannot invoke "eu.knowledge.engine.smartconnector.messaging.AnswerMessage.getFromKnowledgeInteraction()" because "answerMessage" is null
asking-sc-1      |      at eu.knowledge.engine.smartconnector.impl.ReasonerProcessor$AnswerBindingSetHandler.lambda$handle$1(ReasonerProcessor.java:425)
asking-sc-1      |      at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646)
asking-sc-1      |      ... 9 more

Check whether this problem still occurs in the master branch which contains the new matching algorithm for the reasoner and also includes some changes to the ReasonerProcessor. If it does, make sure the InteractionProces continues and the KB gets informed with a valid error message.

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