This is an automated email from the ASF dual-hosted git repository. joerghoh pushed a commit to branch SLING-13046 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-event.git
commit 44b14b492818fb973eaf92d91a73c40b99739f6a Author: Joerg Hoh <[email protected]> AuthorDate: Sun Jan 4 17:51:24 2026 +0100 SLING-13046 log an error in case the thread terminates unexpectetly --- .../event/impl/jobs/config/TopologyHandler.java | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java b/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java index b922f87..cf940f7 100644 --- a/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java +++ b/src/main/java/org/apache/sling/event/impl/jobs/config/TopologyHandler.java @@ -88,21 +88,25 @@ public class TopologyHandler implements TopologyEventListener, Runnable { @Override public void run() { - while (isActive.get()) { - QueueItem item = null; - try { - item = this.queue.take(); - } catch (final InterruptedException ie) { - logger.warn("Thread got interrupted.", ie); - Thread.currentThread().interrupt(); - isActive.set(false); - } - if (isActive.get() && item != null && item.event != null) { - final JobManagerConfiguration config = this.configuration; - if (config != null) { - config.handleTopologyEvent(item.event); + try { + while (isActive.get()) { + QueueItem item = null; + try { + item = this.queue.take(); + } catch (final InterruptedException ie) { + logger.warn("Thread got interrupted.", ie); + Thread.currentThread().interrupt(); + isActive.set(false); + } + if (isActive.get() && item != null && item.event != null) { + final JobManagerConfiguration config = this.configuration; + if (config != null) { + config.handleTopologyEvent(item.event); + } } } + } catch (Throwable t) { + logger.error("TopologyListener thread terminated unexpectetly", t); } }
