Browse Source

Avoiding running IO on scheduler thread in ResourceWatcherService (#96251)

Keith Massey 2 years ago
parent
commit
64651be9c5

+ 5 - 0
docs/changelog/96251.yaml

@@ -0,0 +1,5 @@
+pr: 96251
+summary: Avoiding running IO on scheduler thread in `ResourceWatcherService`
+area: Watcher
+type: bug
+issues: []

+ 3 - 3
server/src/main/java/org/elasticsearch/watcher/ResourceWatcherService.java

@@ -94,9 +94,9 @@ public class ResourceWatcherService implements Closeable {
         interval = RELOAD_INTERVAL_HIGH.get(settings);
         highMonitor = new ResourceMonitor(interval, Frequency.HIGH);
         if (enabled) {
-            lowFuture = threadPool.scheduleWithFixedDelay(lowMonitor, lowMonitor.interval, Names.SAME);
-            mediumFuture = threadPool.scheduleWithFixedDelay(mediumMonitor, mediumMonitor.interval, Names.SAME);
-            highFuture = threadPool.scheduleWithFixedDelay(highMonitor, highMonitor.interval, Names.SAME);
+            lowFuture = threadPool.scheduleWithFixedDelay(lowMonitor, lowMonitor.interval, Names.GENERIC);
+            mediumFuture = threadPool.scheduleWithFixedDelay(mediumMonitor, mediumMonitor.interval, Names.GENERIC);
+            highFuture = threadPool.scheduleWithFixedDelay(highMonitor, highMonitor.interval, Names.GENERIC);
         } else {
             lowFuture = null;
             mediumFuture = null;