summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgjoranv <gjoranv@gmail.com>2018-04-12 17:22:52 +0200
committerGitHub <noreply@github.com>2018-04-12 17:22:52 +0200
commit8a814b61e01de1093df11a3e2957b548812e81eb (patch)
tree8ec2949077103bdf2bd5a72626684b67a6c9c581
parent3eb37969b303648f4074d70aff81d1889484f9e3 (diff)
parent412bf5ef7778f1d458ce85d4d621813279e19623 (diff)
Merge pull request #5558 from vespa-engine/bjorncs/container-watchdog
Fix bug where container watchdog stored wrong activation time
-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));
- }
}
}