From b7776e48ac773c67ae55448b0f7348d587c7c9e1 Mon Sep 17 00:00:00 2001 From: Barry Nouwt Date: Fri, 18 Jul 2025 13:22:31 +0200 Subject: [PATCH] Notify SCs when a KER has gone. This allows them to update their OtherKnowledgeBaseStore accordingly. --- .../runtime/messaging/RemoteKerConnectionManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java index 63ba0a47c..a8cb82aac 100644 --- a/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java +++ b/smart-connector/src/main/java/eu/knowledge/engine/smartconnector/runtime/messaging/RemoteKerConnectionManager.java @@ -144,6 +144,13 @@ private synchronized void queryKnowledgeDirectory() { LOG.info("Removing peer that is now gone: {}", e.getValue().getRemoteKerUri()); it.remove(); this.unavailableRemoteKerConnections.remove(e.getKey()); + + // make sure all SCs are notified correctly. We use fake/empty details for that. + KnowledgeEngineRuntimeDetails details = new KnowledgeEngineRuntimeDetails(); + details.setRuntimeId(e.getValue().getRemoteKerUri().toString()); + details.setSmartConnectorIds(new ArrayList<>()); + e.getValue().updateKerDetails(details); + } } this.knowledgeDirectoryUpdateCooldownEnds = new Date(