From 1d596e78db2406e19993c2e96b5f867df3ebca36 Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Fri, 9 Jun 2017 12:43:00 +0200 Subject: Use scheduleAtFixedRate instead of scheduleWithFixedDelay --- .../com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'jdisc_core/src') diff --git a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java index 96bbb6a4111..a6b4ef03c61 100644 --- a/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java +++ b/jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java @@ -44,7 +44,7 @@ class ActiveContainerDeactivationWatchdog implements ActiveContainerMetrics, Aut ActiveContainerDeactivationWatchdog() { this( Clock.systemUTC(), - new ScheduledThreadPoolExecutor(1, runnable -> { + new ScheduledThreadPoolExecutor(2, runnable -> { Thread thread = new Thread(runnable, "active-container-deactivation-watchdog"); thread.setDaemon(true); return thread; @@ -54,12 +54,12 @@ class ActiveContainerDeactivationWatchdog implements ActiveContainerMetrics, Aut ActiveContainerDeactivationWatchdog(Clock clock, ScheduledExecutorService scheduler) { this.clock = clock; this.scheduler = scheduler; - this.scheduler.scheduleWithFixedDelay( + this.scheduler.scheduleAtFixedRate( this::warnOnStaleContainers, WATCHDOG_FREQUENCY.getSeconds(), WATCHDOG_FREQUENCY.getSeconds(), TimeUnit.SECONDS); - this.scheduler.scheduleWithFixedDelay( + this.scheduler.scheduleAtFixedRate( ActiveContainerDeactivationWatchdog::triggerGc, GC_TRIGGER_FREQUENCY.getSeconds(), GC_TRIGGER_FREQUENCY.getSeconds(), -- cgit v1.2.3