From 412bf5ef7778f1d458ce85d4d621813279e19623 Mon Sep 17 00:00:00 2001 From: Bjørn Christian Seime Date: Thu, 12 Apr 2018 12:56:27 +0200 Subject: Fix bug where container watchdog stored wrong activation time --- .../yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'jdisc_core') 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 b353cdad64a..e41c149c0af 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 @@ -95,13 +95,12 @@ class ActiveContainerDeactivationWatchdog implements ActiveContainerMetrics, Aut void onContainerActivation(ActiveContainer nextContainer) { synchronized (monitor) { Instant now = clock.instant(); - ActiveContainer previousContainer = currentContainer; + if (currentContainer != null) { + deactivatedContainers.put(currentContainer, new LifecycleStats(currentContainerActivationTime, now)); + destructorReferences.add(new ActiveContainerPhantomReference(currentContainer, garbageCollectedContainers)); + } currentContainer = nextContainer; currentContainerActivationTime = now; - if (previousContainer != null) { - deactivatedContainers.put(previousContainer, new LifecycleStats(currentContainerActivationTime, now)); - destructorReferences.add(new ActiveContainerPhantomReference(previousContainer, garbageCollectedContainers)); - } } } -- cgit v1.2.3