diff --git a/src/server/src/main/java/io/cassandrareaper/jmx/JmxProxyImpl.java b/src/server/src/main/java/io/cassandrareaper/jmx/JmxProxyImpl.java index c9af8b60e..358c84011 100644 --- a/src/server/src/main/java/io/cassandrareaper/jmx/JmxProxyImpl.java +++ b/src/server/src/main/java/io/cassandrareaper/jmx/JmxProxyImpl.java @@ -849,18 +849,26 @@ public Map getSimpleStates() { * ordinal of AntiEntropyService.Status */ @Override - public void handleNotification(Notification notification, Object handback) { - Thread.currentThread().setName(clusterName); - // we're interested in "repair" - String type = notification.getType(); - LOG.debug("Received notification: {} with type {}", notification, type); - if (("repair").equals(type)) { - processOldApiNotification(notification); - } + public void handleNotification(final Notification notification, Object handback) { + // pass off the work immediately to a separate thread + EXECUTOR.submit(() -> { + String threadName = Thread.currentThread().getName(); + try { + Thread.currentThread().setName(clusterName); + // we're interested in "repair" + String type = notification.getType(); + LOG.debug("Received notification: {} with type {}", notification, type); + if (("repair").equals(type)) { + processOldApiNotification(notification); + } - if (("progress").equals(type)) { - processNewApiNotification(notification); - } + if (("progress").equals(type)) { + processNewApiNotification(notification); + } + } finally { + Thread.currentThread().setName(threadName); + } + }); } /**