diff --git a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java b/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java index 74a129b99b5c..9708e905a492 100644 --- a/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java +++ b/dubbo-monitor/dubbo-monitor-api/src/main/java/org/apache/dubbo/monitor/support/AbstractMonitorFactory.java @@ -85,8 +85,8 @@ public Monitor getMonitor(URL url) { final URL monitorUrl = url; final CompletableFuture completableFuture = CompletableFuture.supplyAsync(() -> AbstractMonitorFactory.this.createMonitor(monitorUrl)); - completableFuture.thenRunAsync(new MonitorListener(key), executor); FUTURES.put(key, completableFuture); + completableFuture.thenRunAsync(new MonitorListener(key), executor); return null; } finally {