Skip to content

Commit

Permalink
Avoiding running IO on scheduler thread in ResourceWatcherService (#9…
Browse files Browse the repository at this point in the history
  • Loading branch information
masseyke committed May 22, 2023
1 parent 59c1b19 commit fb243a9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions docs/changelog/96251.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pr: 96251
summary: Avoiding running IO on scheduler thread in `ResourceWatcherService`
area: Watcher
type: bug
issues: []
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ public ResourceWatcherService(Settings settings, ThreadPool threadPool) {
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;
Expand Down

0 comments on commit fb243a9

Please sign in to comment.