summaryrefslogtreecommitdiffstats
path: root/jdisc_core
diff options
context:
space:
mode:
authorBjørn Christian Seime <bjorncs@oath.com>2018-04-12 12:56:27 +0200
committerBjørn Christian Seime <bjorncs@oath.com>2018-04-12 12:56:27 +0200
commit412bf5ef7778f1d458ce85d4d621813279e19623 (patch)
tree4ee9c0e47802db917cc3e8d7d6e4b5c88f412333 /jdisc_core
parenteac5237fb03725d42556f1a54558411a5ee178ab (diff)
Fix bug where container watchdog stored wrong activation time
Diffstat (limited to 'jdisc_core')
-rw-r--r--jdisc_core/src/main/java/com/yahoo/jdisc/core/ActiveContainerDeactivationWatchdog.java9
1 files changed, 4 insertions, 5 deletions
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));
- }
}
}